Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Error on node-gyp rebuild while installing packages with npm #50

Closed
janschumann opened this issue May 19, 2014 · 3 comments · Fixed by #51
Closed

Error on node-gyp rebuild while installing packages with npm #50

janschumann opened this issue May 19, 2014 · 3 comments · Fixed by #51
Labels

Comments

@janschumann
Copy link

While installing packages that require a node-gyp rebuild (like zombie) the following error occurs:

Error: node-gyp requires that the user's home directory is specified in either of the environmental variables HOME or USERPROFILE

This is a fix for that (in puppet/provider/package/npm.rb) (borrowed from puppet labs-nodejs):

  if Puppet::Util::Package.versioncmp(Puppet.version, '3.0') >= 0
    has_command(:npm, 'npm') do
      is_optional
      environment :HOME => "/root"
    end
  else
    optional_commands :npm => 'npm'
  end
@willdurand willdurand added the bug label May 19, 2014
@janschumann
Copy link
Author

If you want I can send a pull request. I am testing right now on Ubuntu 12.04, 14.04 and Debian 7.5.0 ...

@willdurand
Copy link
Owner

yup

@psychemedia
Copy link

I think I'm getting this same issue trying to install tty.js - it worked fine for me on a Linux 13.04 box, but I just moved to 14.04 [config.vm.box = "phusion/ubuntu-14.04-amd64" ] and it's started to fail (message below).

I tried to add puppet/provider/package/npm.rb as suggested above, but continue to get the same error?
MY ERROR - swapping in #commands :npm => 'npm' and using the above code does fix the installation errors

Error: Execution of '/usr/local/bin/npm install --global tty.js' returned 1: npm http GET https://registry.npmjs.org/tty.js
npm http 304 https://registry.npmjs.org/tty.js
npm http GET https://registry.npmjs.org/pty.js
npm http GET https://registry.npmjs.org/term.js
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/term.js
npm http 304 https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/pty.js
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/range-parser
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/cookie
npm http GET https://registry.npmjs.org/buffer-crc32
npm http GET https://registry.npmjs.org/fresh
npm http GET https://registry.npmjs.org/methods
npm http GET https://registry.npmjs.org/send
npm http GET https://registry.npmjs.org/cookie-signature
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/socket.io-client
npm http GET https://registry.npmjs.org/policyfile
npm http GET https://registry.npmjs.org/base64id
npm http GET https://registry.npmjs.org/redis
npm http 304 https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/range-parser
npm http 304 https://registry.npmjs.org/commander

> [email protected] install /usr/local/lib/node_modules/tty.js/node_modules/pty.js
> node-gyp rebuild


/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:54
    throw new Error(
          ^
Error: node-gyp requires that the user's home directory is specified in either of the environmental variables HOME or USERPROFILE
    at new Gyp (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:54:11)
    at gyp (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:43:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:20:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
npm http 304 https://registry.npmjs.org/fresh
npm http 304 https://registry.npmjs.org/buffer-crc32
npm http 304 https://registry.npmjs.org/cookie
npm http 304 https://registry.npmjs.org/send
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the pty.js 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 pty.js
npm ERR! There is likely additional logging output above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants