简体   繁体   English

npm install zmq 在 node-gyp 重建时出现错误

[英]npm install zmq giving error as node-gyp rebuild

i am really stuck with this problem and my dev haults, did lot of google search but confused what is the solution, i am sure any i will get help in this forum.我真的被这个问题和我的开发人员困住了,做了很多谷歌搜索,但很困惑解决方案是什么,我相信我会在这个论坛上得到帮助。

i am on ubuntu 13.04 node - 0.11.10-pre zmq already installed through standard process below: http://zeromq.org/intro:get-the-software python - 2.7我是Ubuntu的13.04节点上- 0.11.10预ZMQ已经通过标准流程如下安装: http://zeromq.org/intro:get-the-software蟒蛇- 2.7

zishan@news01:~$ sudo npm install zmq
npm http GET https://registry.npmjs.org/zmq
npm http 304 https://registry.npmjs.org/zmq
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/set-immediate
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/set-immediate

zmq@2.5.1 install /home/zishan/node_modules/zmq
node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:65:16)
gyp ERR! stack at Object.self.commands.(anonymous function) as install
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:150:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:93:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:694:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:104:17)
gyp ERR! stack at maybeClose (child_process.js:808:16)
gyp ERR! stack at Process.ChildProcess.handle.onexit (childprocess.js:875:5)
gyp ERR! System Linux 3.8.0-19-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/zishan/node_modules/zmq
gyp ERR! node -v v0.11.10-pre
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! zmq@2.5.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zmq@2.5.1 install script.
npm ERR! This is most likely a problem with the zmq 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 zmq
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "zmq"
npm ERR! cwd /home/zishan
npm ERR! node -v v0.11.10-pre
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/zishan/npm-debug.log
npm ERR! not ok code 0

Ok, i figured it out using below links好的,我用下面的链接弄明白了

First i removed nodejs completely using below.首先,我使用下面的方法完全删除了 nodejs。 How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) 如何完全卸载 Node.js,并从头开始重新安装 (Mac OS X)

then, i installed the Node version manager to install node 0.10 (which is stable version) https://github.com/creationix/nvm然后,我安装了节点版本管理器来安装节点 0.10(这是稳定版本) https://github.com/creationix/nvm

All is working like a charm and zmq installed with no issues.一切都像魅力一样工作,zmq 安装没有问题。

I think earlier i was using node 0.11.xx-pre version which is in beta and have issues with node-gyp, node 0.10 is working without issues.我想早些时候我使用的是处于测试阶段的 node 0.11.xx-pre 版本,并且 node-gyp 有问题,node 0.10 工作没有问题。

hope this will help someone else as it took me long time to figure out.希望这会对其他人有所帮助,因为我花了很长时间才弄明白。

I think your Node version is too high and therefore not compatible.我认为您的 Node 版本太高,因此不兼容。 Read:阅读:

... gyp ERR! node -v v0.11.10-pre gyp ERR! node-gyp -v v0.12.1 gyp ERR! not ok ...

If you downgrade Node and retry you should be good to go.如果你降级 Node 并重试,你应该很高兴。 Note that that it is quite important to have your Xcode path at the correct place.请注意,将 Xcode 路径放在正确的位置非常重要。 Use sudo xcode-select -switch /Applications/Xcode.app使用sudo xcode-select -switch /Applications/Xcode.app

Also use brew --config to make sure other things are in order.还可以使用brew --config来确保其他事情都井井有条。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM