coffeescript fails to find nodejs in path

Bug #777554 reported by Todd A. Jacobs
58
This bug affects 11 people
Affects Status Importance Assigned to Milestone
coffeescript (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: coffeescript

After installing coffeescript and nodejs, running "coffee" should present a REPL prompt. However:

$ coffee
/usr/bin/env: nodejs: No such file or directory

This appears to be because coffeescript is expecting "nodejs" in the path, but the executable provided by the current nodejs package is "node." This makes coffeescript unusable out of the box, although there *is* a workaround.

Assuming ~/bin is in the user's path, creating a symlink there will enable the user launch an interactive prompt properly.

$ cd ~/bin; ln -s /usr/bin/node nodejs

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: coffeescript 0.7.0-1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Wed May 4 20:26:09 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Beta amd64 (20110330)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: coffeescript
UpgradeStatus: No upgrade log present (probably fresh install)

WORKAROUND: install "nodejs-legacy" package.

Revision history for this message
Todd A. Jacobs (codegnome) wrote :
Changed in coffeescript (Ubuntu):
status: New → Confirmed
Revision history for this message
Richard Merren (richard-merren) wrote :

I was also able to workaround with a link in /usr/bin:

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

This creates the link globally, which may be the source for other grief later on. But it lets coffee work.

Revision history for this message
Joshua Harlan Lifton (joshua-harlan-lifton) wrote :

See also bug #855712.

Revision history for this message
Bryan Richter (bryan-richter) wrote :

I'm copying the patch from #855712 over here. It was authored by Craig Maloney (https://launchpad.net/~craig-decafbad).

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Execute script with 'node' and not 'nodejs'" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Ralph Alex (ralphalex9) wrote :

Same error /usr/bin/env

Revision history for this message
Carsten Kämmerer (ckxx) wrote :

I have nearly the same problem in ubuntu 12.10. I installed coffee like this:

sudo sudo apt-get install nodejs npm
sudo npm install -g coffee-script

But unlike the other people here reported for the 11.04 release, my result in 12.10 is exactly the other way: coffee tries to access 'node' (instead of 'nodejs' in 11.04), but in my filesystem there is only a nodejs (instead of 'node' in 11.04).

I get:

$ coffee
/usr/bin/env: node: No such file or directory

So my workaround in 12.10 is exactly the other way (as suggested for 11.04):

$ cd ~/bin; ln -s /usr/bin/nodejs node

Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

The right executable for it to use now would be "nodejs".

description: updated
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

Carsten, install the coffeescript package instead (or the one for Raring if you need a newer). Or install the "nodejs-legacy" package.

This problem is fixed in Quantal and Raring (it calls "nodejs").

Changed in coffeescript (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

Or to be correct, it is fixed in the nodejs package, as the executable is now there called "nodejs".

Revision history for this message
Christiano Moreira (chrislevita) wrote :

I did the same as Richard Merren (richard-merren), but the "opposite", becuase I had nodejs but not node, and worked well:

My problem:
cmd: $ coffee -v
error msg: /usr/bin/env: node: No such file or directory

fixed by:
cmd: $ sudo ln -s /usr/bin/nodejs /usr/bin/node

----------------------------------------------------------
Richard Merren (richard-merren) wrote on 2011-08-11: #2
I was also able to workaround with a link in /usr/bin:

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

This creates the link globally, which may be the source for other grief later on. But it lets coffee work.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.