I've installed node using nvm, but when I go in my project folder and try to run npm install it shows npm not found.

However I tried to install gulp globaly with sudo npm install -g gulp it worked.

When I use which npm it shows /home/USER/.nvm/versions/node/v14.13.1/bin/npm

How to overcome this and be able to use npm install inside my project folders?

1 Answer 1


Have you initiated the npm project, using npm init? To be able to install npm packages in a folder, there has to be an npm project present in that folder. (Also read https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/development_environment to learn more about setting up npm)

Otherwise, could you try running npm -v and see what the output is?

  • I made mistake, not selecting the version of node via nvm. It works now, hopefully, it will stay that way. Oct 11, 2020 at 16:53
  • Ah okay! I'm glad it's working for you now :)
    – Mithras
    Oct 11, 2020 at 16:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .