2015-10-27 235 views
0

我試圖安裝節點包canvasnpm install canvas -g),但得到這個錯誤:節點包無法安裝

> [email protected] install /home/user/WebstormProjects/testing/node_modules/canvas 
> node-gyp rebuild 

./util/has_cairo_freetype.sh: 4: ./util/has_cairo_freetype.sh: pkg-config: not found 
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. while trying to load binding.gyp 
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:355:16) 
gyp ERR! stack  at emitTwo (events.js:87:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:172:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) 
gyp ERR! System Linux 3.16.0-4-amd64 
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /home/user/WebstormProjects/testing/node_modules/canvas 
gyp ERR! node -v v4.2.1 
gyp ERR! node-gyp -v v3.0.3 
gyp ERR! not ok 
npm ERR! Linux 3.16.0-4-amd64 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "canvas" 
npm ERR! node v4.2.1 
npm ERR! npm v2.14.7 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. 
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! Please include the following file with any support request: 
npm ERR!  /home/user/WebstormProjects/testing/npm-debug.log 

libicu-dev的和節點GYP安裝。問題是什麼?

回答

2

從HenryHey誰發現它Epistemex

當我遇到的「包開羅未發現」問題在Ubuntu 12.10,我通過解決它:sudo易於得到安裝libcairo2-dev的

緊接其後我遇到了這個錯誤:jpeglib.h:沒有這樣的文件或目錄,這是通過解決:sudo apt-get install libjpeg-dev

最後,我遇到了這個問題:gif_lib.h:沒有這樣的文件或目錄,解決它通過:sudo apt-get install libgif-dev

希望這可以幫助未來的人。

+0

我根據說明做了一切,現在又出現了另一個錯誤。編輯第一條消息。 – Vladimir37

+0

如果發現新錯誤,請將我的標記標記爲正確並提交新問題,而不是編輯您的帖子。 – PolarisUser