2

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

3
  • Did you try the full path to the npm executable in your script? Commented Jan 9, 2022 at 17:25
  • thanks, but sounds like bad idea Commented Jan 9, 2022 at 17:36
  • Why? The full path the the npm command is the best solution. Commented Jan 9, 2022 at 17:38

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.