NoCache

Preview of Run Node.js and NPM with Sudo (Fix "Command not Found" with NVM)

Run Node.js and NPM with Sudo (Fix "Command not Found" with NVM)

Cyrus Kao

While using NVM on Linux, it loads Node.js and NPM from .bashrc in the home directory of your user. However, if you execute the command with sudo like sudo npm start it will result in sudo: npm: command not found since .bashrc of root is not managed by NVM.