简体   繁体   中英

'node-gyp' error in installing npm packages

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

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

What is happening here and what is node-gyp actually

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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