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- | sudo bash
Here's the git repo that proposed the above command as a solution.

Also Read:

  1. Use node in es6 syntax with babel transpiling
  2. What is an npmignore file and what is it used for
  3. Setup nginx with multi domain websites running on nodejs
  4. Understanding nodejs module exports and require
  5. Understanding semver versioning for your nodejs packages
  6. Accessing the request body and session in nodejs using express
  7. Installing, Listing and Uninstalling packages using npm
  8. Configuring jshint as a pre-commit hook for your nodejs applications