Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 模块jenkins用户ELIFECYCLE的npm安装失败_Node.js_Ubuntu_Jenkins_Npm_Node Gyp - Fatal编程技术网

Node.js 模块jenkins用户ELIFECYCLE的npm安装失败

Node.js 模块jenkins用户ELIFECYCLE的npm安装失败,node.js,ubuntu,jenkins,npm,node-gyp,Node.js,Ubuntu,Jenkins,Npm,Node Gyp,我们有一个运行Jenkins的EC2 Ubuntu box,它构建并测试一个节点应用程序。詹金斯做的部分工作是下载依赖项。其中一个依赖项hashring在安装时出现ELIFECYCLE错误。但是,该错误仅在使用jenkins用户安装时发生。我可以用ubuntu用户安装sudo,但我似乎不能用jenkins用户安装这个软件包。jenkins用户可以很好地安装所有其他软件包。下面是一个为ubuntu而不是为jenkins安装hashring的示例,然后jenkins成功安装了express 有什么想

我们有一个运行Jenkins的EC2 Ubuntu box,它构建并测试一个节点应用程序。詹金斯做的部分工作是下载依赖项。其中一个依赖项hashring在安装时出现ELIFECYCLE错误。但是,该错误仅在使用jenkins用户安装时发生。我可以用ubuntu用户安装sudo,但我似乎不能用jenkins用户安装这个软件包。jenkins用户可以很好地安装所有其他软件包。下面是一个为ubuntu而不是为jenkins安装hashring的示例,然后jenkins成功安装了express

有什么想法吗?我觉得我什么都读过,什么都试过了。我已经完全卸载并重新安装了node、npm和node gyp,并根据这个问题尝试使用每个版本的不同版本组合,但似乎没有效果

ubuntu@ip-10-0-0-10:~$ sudo npm install hashring
\
> hashring@3.1.0 install /home/ubuntu/node_modules/hashring
> node-gyp rebuild

make: Entering directory `/home/ubuntu/node_modules/hashring/build'
  CXX(target) Release/obj.target/hashvalue/src/hashvalue.o
  SOLINK_MODULE(target) Release/obj.target/hashvalue.node
  SOLINK_MODULE(target) Release/obj.target/hashvalue.node: Finished
  COPY Release/hashvalue.node
make: Leaving directory `/home/ubuntu/node_modules/hashring/build'
hashring@3.1.0 node_modules/hashring
├── bindings@1.2.1
├── connection-parse@0.0.7
├── simple-lru-cache@0.0.1
└── nan@1.5.3
ubuntu@ip-10-0-0-10:~$ sudo su root
root@ip-10-0-0-10:/home/ubuntu# su jenkins
jenkins@ip-10-0-0-10:/home/ubuntu$ cd ~/workspace/test
jenkins@ip-10-0-0-10:~/workspace/test$ npm install hashring

> hashring@3.1.0 install /var/lib/jenkins/workspace/test/node_modules/hashring
> node-gyp rebuild

gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: spawn ENOTDIR
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at ChildProcess.spawn (child_process.js:1155:11)
gyp ERR! stack     at exports.spawn (child_process.js:988:9)
gyp ERR! stack     at exports.execFile (child_process.js:682:15)
gyp ERR! stack     at checkPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:79:5)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:46:9
gyp ERR! stack     at which (/usr/local/lib/node_modules/npm/node_modules/which/which.js:30:31)
gyp ERR! stack     at checkPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:36:5)
gyp ERR! stack     at configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:31:3)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as configure] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/lib/jenkins/workspace/test/node_modules/hashring
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.3
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/TooTallNate/node-gyp/issues>
npm ERR! Linux 3.13.0-36-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "hashring"
npm ERR! node v0.12.1
npm ERR! npm  v2.7.3
npm ERR! code ELIFECYCLE

npm ERR! hashring@3.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the hashring@3.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the hashring 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 their info via:
npm ERR!     npm owner ls hashring
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/lib/jenkins/workspace/test/npm-debug.log
jenkins@ip-10-0-0-10:~/workspace/test$ npm install express
express@4.12.3 node_modules/express
├── merge-descriptors@1.0.0
├── utils-merge@1.0.0
├── cookie-signature@1.0.6
├── methods@1.1.1
├── fresh@0.2.4
├── cookie@0.1.2
├── escape-html@1.0.1
├── range-parser@1.0.2
├── finalhandler@0.3.4
├── content-type@1.0.1
├── vary@1.0.0
├── parseurl@1.3.0
├── serve-static@1.9.2
├── content-disposition@0.5.0
├── path-to-regexp@0.1.3
├── depd@1.0.0
├── on-finished@2.2.0 (ee-first@1.1.0)
├── qs@2.4.1
├── debug@2.1.3 (ms@0.7.0)
├── proxy-addr@1.0.7 (forwarded@0.1.0, ipaddr.js@0.1.9)
├── etag@1.5.1 (crc@3.2.1)
├── send@0.12.2 (destroy@1.0.3, ms@0.7.0, mime@1.3.4)
├── accepts@1.2.5 (negotiator@0.5.1, mime-types@2.0.10)
└── type-is@1.6.1 (media-typer@0.3.0, mime-types@2.0.10)
jenkins@ip-10-0-0-10:~/workspace/test$ 

事实证明,我们必须使用python路径为npm添加一个配置

来自jenkins用户:

npm配置集python/usr/bin/python