Ws: fails to install on ubuntu14.04 because "nodejs" not "node" is the binary name of node.js on debian

Created on 25 Feb 2015  路  2Comments  路  Source: websockets/ws

node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
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.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-26-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/muenalan/http/mue-nodejs/cc_materialize/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

$ less /usr/share/doc/nodejs/README.Debian

[snip]

 29 nodejs command
 30 --------------
 31 
 32 The upstream name for the Node.js interpreter command is "node".
 33 In Debian the interpreter command has been changed to "nodejs".
 34 
 35 This was done to prevent a namespace collision: other commands use
 36 the same name in their upstreams, such as ax25-node from the "node"
 37 package.
 38 
 39 Scripts calling Node.js as a shell command must be changed to instead
 40 use the "nodejs" command.

Most helpful comment

This happens if you apt-get install nodejs package from Ubuntu. This is not the latest 0.10.x version. Here is a solution which I verified works, as suggested here: project ungit issue 401

sudo ln -s /usr/bin/nodejs /usr/bin/node

Though, if you use the recommended Node install procedure for Ubuntu, this issue will also not occur. This will install the latest 0.10.x version, and also resolve your issue.
Joyent Wiki Installing-Node.js Ubuntu

All 2 comments

This happens if you apt-get install nodejs package from Ubuntu. This is not the latest 0.10.x version. Here is a solution which I verified works, as suggested here: project ungit issue 401

sudo ln -s /usr/bin/nodejs /usr/bin/node

Though, if you use the recommended Node install procedure for Ubuntu, this issue will also not occur. This will install the latest 0.10.x version, and also resolve your issue.
Joyent Wiki Installing-Node.js Ubuntu

Closed based on the commented above.

Was this page helpful?
0 / 5 - 0 ratings