I installed Cordova and PhoneGap with npm:
sudo npm install -g cordova
sudo npm install -g phonegap
however, both return the same error message:
/usr/bin/env: node: No such file or directory
I installed Cordova and PhoneGap with npm:
sudo npm install -g cordova
sudo npm install -g phonegap
however, both return the same error message:
/usr/bin/env: node: No such file or directory
it's not finding node or node lib on your path
There different solutions posted here:
https://github.com/joyent/node/issues/3911
A few: PATH:
appending /usr/local/bin:/usr/bin
putenv('PATH=' . getenv('PATH') . ':/usr/local/bin:/usr/bin');
Symlink:
ln -s /usr/bin/nodejs /usr/bin/node
Installing node legacy:
apt-get install nodejs-legacy
Create a shortcut in /usr/local
(not /usr/bin
):
ln -s /usr/bin/nodejs /usr/local/bin/node
According to The Linux Documentation Project, distributions may not install anything in there. It is reserved solely for the use of the local administrator.
This way he/she can be absolutely certain that no updates or upgrades to his distribution will overwrite any extra software he has installed locally.
If you are a full-stack developer requiring later features, I recommend installing the latest Node.JS according Ask Ubuntu instructions.
Remember that Ubuntu 14.04.5 LTS provides Node.JS v0.10.25 (stable).
In your terminal run the following:
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm