Be the first user to complete this post

  • 0
Add to List

Resolved - sudo npm command not found

Recently when I was trying to run my application on an ubuntu virtual server, I kept getting the error npm command not found even though I had installed nvm an node. Based on my searches it seems like if you have installed nvm as a regular user, you wont be able to execute the nvm command with sudo. The only painless way i could find to run nvm with sudo is by installing nvm using sudo itself through the following command

wget -qO- https://raw.githubusercontent.com/xtuple/nvm/master/install.sh | sudo bash
Here's the git repo that proposed the above command as a solution.



Also Read:

  1. nodejs: generate uuid / guid
  2. Access the request body of a post request in your nodejs - expressjs app.
  3. Understanding routers in express 4.0 - Visually
  4. gzip compress and cache api response in express
  5. Creating a simple event emitter using nodejs