I installed node with apt-get install nodejs. Then I installed npm with apt-get install npm. Now when I try to run express I get
$ express
/usr/bin/env: node: No such file or directory
How do I resolve this error?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two package in Ubuntu that have similar names, node and nodejs.
nodedoes this,nodejsdoes this,Fedora also follows a similar package naming scheme. Because of this, the binary in
nodejshad to be renamed tonodejsfrom the originalnode. However, this isn’t technically kosher: and most nodejs programs (and libraries installed with npm) assume that the node binary isnode. If you want to get around this the easiest way is just symlink the two together. If you take this route, don’t install thenodepackage which handles the Amateur Packet Radio stuff.Alternatively, in the case of node, I’d suggest using
nand not installingnode. Just install npm (which will install node), then remove npm, then tell apt to clean it up. To do this, simply runThere are other binary distro managers that even work from a shell script like
nvmbut I personally prefern. Think ofnlike an apt for just one thing: the node binary which it installs to/usr/local/bin.Why are removing npm? We’re not.
apt-get --purge removecan only ever remove things installed by the package manager.n latestworks outside of the package manager. There are two npms if you do this,apt-get.n latest.No point in having the distro’s older version. And, even worse, if that version works it can potentially install to a different location and have Debian modifications in it that assume Debian install directories. It’s better to use either/or but not both.