升级node到v6.9.1之后, 安装模块时 node-gyp出现编译不过去了,请问各位这问题怎么解决?多谢!
发布于 7 年前 作者 fengyh13 7088 次浏览 来自 问答

node version: v6.9.1 node-gyp version: 3.4.0 npm version: 3.10.8

when I install mosca, this issue appear:

gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 3.13.0-100-generic gyp ERR! command “/usr/bin/nodejs” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild" gyp ERR! cwd /opt/project/secretchat_server/node_modules/ascoltatori/node_modules/zmq gyp ERR! node -v v6.9.1 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok

============================split line==================================== gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 3.13.0-100-generic gyp ERR! command “/usr/bin/nodejs” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild" gyp ERR! cwd /opt/project/secretchat_server/node_modules/zmq gyp ERR! node -v v6.9.1 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok

2 回复

我也遇到类似问题

@chrischjh 已经解决,npm 的默认包不是最近的,升级一下就OK了

回到顶部