Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
muenalan opened this issue Feb 24, 2015 · 2 comments

Comments

@muenalan
Copy link

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.
@glennschler
Copy link

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

@3rd-Eden
Copy link
Member

3rd-Eden commented Mar 4, 2015

Closed based on the commented above.

@3rd-Eden 3rd-Eden closed this as completed Mar 4, 2015
adrienverge added a commit to adrienverge/textree that referenced this issue Aug 13, 2016
The upstream name for the Node.js interpreter command is `node`. Thus,
modern distributions ship Node.js binary under `/usr/bin/node`; but
Debian uses the `nodejs` (because of a namespace collision with
`ax25-node`).

Parallely, major Node.js projects use `node` (not `nodejs`), for example
[NPM](https://github.com/npm/npm/blob/master/bin/npm-cli.js#L1),
[Jade](https://github.com/pugjs/pug-cli/blob/master/index.js#L1),
[Gulp](https://github.com/gulpjs/gulp/blob/master/bin/gulp.js#L1)...

This commit changes scripts to use `node` binary instead of `nodejs`,
for interoperability reasons.

FWIW, some Debian & Ubuntu users recommend [symlinking
`node`](websockets/ws#458) or [installing
nodejs-legacy](http://stackoverflow.com/a/21171188).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants