2014-04-09 6 views
3

저는 명령 행에서 작업하는 것이 매우 쉽습니다. 나는 꿀꺽 꿀꺽 마시는 것으로 설정하고있는 프로젝트가 있고, 꿀꺽 꿀꺽 마시는 설치되어 있고 성공적으로 sass 파일을 컴파일하고있다. 그러나 캔버스를 설치할 수 없습니다 :캔버스를 설치하려고 할 때 cario install 명령으로 문제가 발생하지 않습니다.

$ npm install canvas 

종속성으로 인해 캔버스를 설치해야합니다. css-sprite를 실행해야합니다. 다음과 같은 오류가 발생합니다. 카이로, 석영, 자작을 설치했습니다. 다른 티켓을 조사한 후 export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig을 실행하고 다시 설치하려고했습니다. 나는 행운이 없었고 문제를 해결하려는 시도에서 무엇을해야할지 전혀 모릅니다. 여기

npm http GET https://registry.npmjs.org/canvas 
npm http 304 https://registry.npmjs.org/canvas 
npm http GET https://registry.npmjs.org/nan 
npm http 304 https://registry.npmjs.org/nan 

[email protected] install /usr/local/lib/node_modules/canvas 
node-gyp rebuild 

./util/has_cairo_freetype.sh: line 4: pkg-config: command not found 
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. 
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16) 
gyp ERR! stack  at ChildProcess.EventEmitter.emit (events.js:98:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:797:12) 
gyp ERR! System Darwin 13.1.0 
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/local/lib/node_modules/canvas 
gyp ERR! node -v v0.10.26 
gyp ERR! node-gyp -v v0.12.2 
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the canvas package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node-gyp rebuild 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls canvas 
npm ERR! There is likely additional logging output above. 

npm ERR! System Darwin 13.1.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "canvas" 
npm ERR! cwd /Users/kylebebeau/websites/ls/code/templates/ls3 
npm ERR! node -v v0.10.26 
npm ERR! npm -v 1.4.3 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/kylebebeau/websites/ls/code/templates/ls3/npm-debug.log 
npm ERR! not ok code 0 

어떤 도움이나지도가 크게 감상 할 수 ... 오류입니다.

답변

2

이 문제도 발생했습니다. 나는 카이로와 석영을 설치하기 위해 양조를 또한 사용했다. 나는이 지침 here을 따라 갔으며 가장 구체적으로이 단계가 내 문제를 해결했습니다.

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

하면이 세션에 걸쳐 유지하려는 경우 당신이 당신의 .bashrc 또는 .zshrc이 추가되었는지 확인합니다. 성공적으로 컴파일 한 후 내 node_modules 디렉토리를 삭제하고 새 터미널 세션에서 npm install을 다시 시도했으며 다시 컴파일하려면 PKG_CONFIG_PATH를 다시 ​​내 보내야했습니다.

다음은 내 출력을 간략히 보여줍니다.

$ npm install 
> node-gyp rebuild 
Package xcb-shm was not found in the pkg-config search path. 
Perhaps you should add the directory containing `xcb-shm.pc' 
to the PKG_CONFIG_PATH environment variable 
Package 'xcb-shm', required by 'cairo', not found 
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. while trying to load binding.gyp 
gyp ERR! configure error 
... 

$ export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig 
$ npm install        

$ [email protected] install $HOME/projects/canvas/node_modules/canvas 
$ node-gyp rebuild 
... 
Successful Compile 

npm start

이 시점

I는이에 실행 다른 사람을 도움이되기를 바랍니다에서 오류없이 작동했다.