Sruj
Sruj

Reputation: 1207

"Command 'npm' not found" after open terminal, but npm -v show it is installed (installation used nvm)

I installed npm and node using nvm, and it work's fine, but after computer rebot it shows some errors.

Right after rebot open dialog (in Polish language) saying:

error loading the file /home/pawel/.profile /home/pawel/.bashrc: line 5: npm: command not found

right after open terminal this shows just after computer rebot enter image description here home folder .npm folder home/pawel/.profile

Upvotes: 2

Views: 418

Answers (1)

Criminal_Affair_At_SO
Criminal_Affair_At_SO

Reputation: 3473

You are using nvm which allows you to have multiple versions of Node.js and to automatically select one of them. This works by placing a script at the end of your .bashrc that allows the correct Node.js to be picked up. So if you try to access npm in the beginning of that same script, it won't work because that path has not been set up.

Upvotes: 1

Related Questions