安装 npm 包时出现“node-gyp"错误 [英] 'node-gyp' error in installing npm packages

查看:768
本文介绍了安装 npm 包时出现“node-gyp"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过 npm 安装zmq"时出现此错误

I am getting this error when I am trying to install "zmq" through npm

  oem@saurabh:~/Desktop/watcher/messaging$ npm install zmq

> zmq@2.15.3 install /home/oem/Desktop/watcher/messaging/node_modules/zmq
> node-gyp rebuild

make: Entering directory '/home/oem/Desktop/watcher/messaging/node_modules/zmq/build'
  CXX(target) Release/obj.target/zmq/binding.o
../binding.cc:28:10: fatal error: zmq.h: No such file or directory
 #include <zmq.h>
          ^~~~~~~
compilation terminated.
zmq.target.mk:101: recipe for target 'Release/obj.target/zmq/binding.o' failed
make: *** [Release/obj.target/zmq/binding.o] Error 1
make: Leaving directory '/home/oem/Desktop/watcher/messaging/node_modules/zmq/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-39-generic
gyp ERR! command "/usr/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/oem/Desktop/watcher/messaging/node_modules/zmq
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN messaging@1.0.0 No description
npm WARN messaging@1.0.0 No repository field.
npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "zmq"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! zmq@2.15.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zmq@2.15.3 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs zmq
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls zmq
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/oem/Desktop/watcher/messaging/npm-debug.log

我使用的是 linux,我已经安装了 zmq &node-gyp 全局然后它也一次又一次地给出相同的错误

I am using linux,i have installed zmq & node-gyp globally then also it is giving same error again and again

这里发生了什么以及 node-gyp 实际上是什么

What is happening here and what is node-gyp actually

推荐答案

我遇到了同样的问题.尝试安装 zeromq 而不是 zmq.Zmq 已弃用,您可以在此处查看:https://github.com/zeromq/zeromq.js/issues/123

I had the same problem. Try to install zeromq instead of zmq. Zmq is deprecated, as you can check here: https://github.com/zeromq/zeromq.js/issues/123

这篇关于安装 npm 包时出现“node-gyp"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆