NPM Command Not Found

13,172

Solution 1

I was hung up on this too. I installed node via nvm and could not run npm or node. I had to run nvm use 0.10.10

then which node and which npm worked again.

if you have installed npm via nvm you might want to add nvm use <version> to your .bashrc file so that you'll have npm always available on any shell you open. You just need to remember to update it whenever you update npm, or use stable.

Solution 2

It could be a permission issue as well. If so you need to run this: sudo chown -R $USER /usr/local

This worked for me

Share:
13,172
Connor Black
Author by

Connor Black

Updated on July 23, 2022

Comments

  • Connor Black
    Connor Black almost 2 years

    I just updated node (through the nodejs.org package installer) and now npm won't work.

    npm: command not found

    Any idea what's going on?

  • Wanjia
    Wanjia over 6 years
    Do you have a solution for windows too?