node-gyp构建错误java模块

时间:2017-07-13 18:55:56

标签: javascript java node.js npm node-gyp

我在尝试在我的NodeJS应用程序中安装JAVA模块时遇到了麻烦。 我正在研究Ubuntu:

  • NodeJS: v6.2.0
  • NPM: 3.8.9
  • Node-gyp: v3.3.1
  • Pyhton: 2.7.12
  • GCC: 5.4.0

我在尝试npm install时遇到了所有这些错误:

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/nsanz/.nvm/versions/node/v6.2.0/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:204:12)
gyp ERR! System Linux 4.4.0-21-generic
gyp ERR! command "/home/nsanz/.nvm/versions/node/v6.2.0/bin/node" "/home/nsanz/.nvm/versions/node/v6.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/nsanz/Documentos/projects/node-parse-tgd/node_modules/java
gyp ERR! node -v v6.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/home/nsanz/.nvm/versions/node/v6.2.0/bin/node" "/home/nsanz/.nvm/versions/node/v6.2.0/bin/npm" "install"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE

npm ERR! java@0.6.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the java@0.6.1 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 java 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 java
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls java
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/nsanz/Documentos/projects/node-parse-tgd/npm-debug.log

我已经尝试重新安装node-gyp和build-essentials,但仍然无法安装JAVA模块。

1 个答案:

答案 0 :(得分:0)

  

当java包含在版本" ^ 0.6.0"中时,我已经看到了这一点。将此值增加到0.7.0或更高可以解决问题。

https://github.com/nodejs/node/issues/10289