【问题标题】:node-gyp build error java modulenode-gyp构建错误java模块
【发布时间】:2017-07-13 18:55:56
【问题描述】:

我在尝试在我的 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 模块。

【问题讨论】:

  • 您是否检查过 Java SDK 和编译器 (javac) 是否已安装并位于当前用户的路径中? (使用which javac,您应该会看到编译器二进制文件的路径)。

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


【解决方案1】:

当 java 包含在版本“^0.6.0”中时,我已经看到了这一点。将其增加到 0.7.0 或更好地解决了这个问题。

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

【讨论】:

    猜你喜欢
    • 2015-01-18
    • 1970-01-01
    • 2014-02-28
    • 1970-01-01
    • 2015-09-27
    • 2018-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多