无法安装Node.js包

时间:2014-05-15 20:52:55

标签: node.js npm

我正在尝试安装Node-ImageMagick plugin。在尝试安装此插件时,我的package.json文件设置如下:

{
  "name": "Test",
  "preferGlobal": true,
  "version": "1.0.0",
  "dependencies" : {
    "colors" : "*",
    "lodash" : "2.4.1",
    "imagemagick-native":"0.2.9"    
  },
  "analyze": false,
  "engines": {
    "node": ">=0.6"
  }
}

当我执行npm install时,我收到错误消息。错误说:

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 /Users/me/source/test/node_modules/imagemagick-native
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm ERR! imagemagick-native@0.2.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the imagemagick-native@0.2.9 install script.
npm ERR! This is most likely a problem with the imagemagick-native 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 imagemagick-native
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"
npm ERR! cwd /Users/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 /Users/me/source/test//node_modules/imagemagick-native
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm ERR! imagemagick-native@0.2.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the imagemagick-native@0.2.9 install script.
npm ERR! This is most likely a problem with the imagemagick-native 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 imagemagick-native
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"
npm ERR! cwd /Users/me/source/test
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/me/source/test/npm-debug.log
npm ERR! not ok code 0

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/me/source/test/npm-debug.log
npm ERR! not ok code 0

我试图在Mac OS X上运行此功能。我已使用命令brew install imagemagick通过终端安装了imagemagick。当我执行echo $PATH时,我看不到imagemagick。我看到以下内容:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:

当我执行sudo find / -name "imagemagick"时,我看到以下内容:

/usr/local/opt/imagemagick

我不确定这是不是问题所在。如果是的话,我不知道如何在Mac OS X中将它添加到我的PATH中。我真诚地感谢能够帮助我克服这个驼峰的任何人。

0 个答案:

没有答案