Ubuntu – Can’t use npm installed packages from command line

command linenpm

I installed node.js and npm recently and was trying to install the learnyounode npm package using sudo npm install -g learnyounode, but after installing I am not able to access it from command line. When I run learnyounode I am getting

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

I checked /usr/local/lib/node_modules to find learnyounode folder in it, not only learnyounode, I am not able to access any npm packages from command line. I am using npm 1.3.10 and node.js 0.10.25.

Best Answer

Try to install like this, then you don't need the sym link. If I were you I'd delete it, because you might not get the updates automatically and always have to "relink" it.

Try it like this:

aptitude install nodejs
apt-get install npm
aptitude install nodejs-legacy

Then try to install npm packages

npm install -g bunyan
npm install -g forever
Related Question