We have an EC2 Ubuntu box running Jenkins that builds and tests a node app. Part of what Jenkins does is download dependencies. One of these dependencies (hashring) is giving an ELIFECYCLE error when installing it. The error only happens when installing with the jenkins user however. I can sudo install with the ubuntu user, but I cannot seem to install this one package with the jenkins user. The jenkins user can install all other packages just fine. Here is an example of hashring installing for ubuntu, not for jenkins, and then jenkins installing express successfully.
Any ideas? I feel like I've read and tried everything. I have completely uninstalled and reinstalled node, npm, and node-gyp and tried using different version combinations of each based on this issue (https://github.com/TooTallNate/node-gyp/issues/598) but it didn't seem to have an effect.
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$