FredrikNoren/ungit

Installation fails on Ubuntu 14.04

vitaut opened this issue · 5 comments

Installing ungit with the command

$ sudo -H npm install -g ungit

fails with the following message:

> ws@0.4.31 install /usr/local/lib/node_modules/ungit/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm ERR! not ok code 0

I have npm version 1.3.10.

I don't think this is related to ungit, at least not directly. Could you include the builderror.log file the error message seems to refer to?

Here's the content of builderror.log:

/bin/sh: 1: node: not found
gyp: Call to 'node -p -e "require('path').dirname(require.resolve('nan'))"' ret$
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.$
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797$
gyp ERR! System Linux 3.13.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ungit/node_modules/socket.io/node_modu$
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok

Strangely, node was not installed when installing npm. However, installing node manually doesn't help either:

$ sudo apt-get install nodejs
$ sudo -H npm install -g ungit
...
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm ERR! not ok code 0

Cuz the binary name in ubuntu is nodejs instead of node.

try to: sudo ln -s /usr/bin/nodejs /usr/bin/node

2014-07-03 16:39 GMT-04:00 vitaut notifications@github.com:

Here's the content of builderror.log:

/bin/sh: 1: node: not found
gyp: Call to 'node -p -e "require('path').dirname(require.resolve('nan'))"' ret$
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.$
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797$
gyp ERR! System Linux 3.13.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ungit/node_modules/socket.io/node_modu$
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok

Strangely, node was not installed when installing npm. However,
installing node manually doesn't help either:

$ sudo apt-get install nodejs
$ sudo -H npm install -g ungit
...
npm http 304 https://registry.npmjs.org/asn1/0.1.11

npm ERR! not ok code 0


Reply to this email directly or view it on GitHub
#401 (comment).

---------------------------------------------------

Thanks @kinncj, it worked. Perhaps it's worth mentioning this in the installation instructions.

A better fix than manually creating the symlink is to install the nodejs-legacy package which does this for you.