0

I followed these steps to install Node and NPM with NVM on MacOS Ventura and it worked fine.

If I try to rerun the install it tells me this:

oleersoy@Oles-MacBook-Pro fs-developer-md % nvm install node
v19.8.1 is already installed.
Now using node v19.8.1 (npm v9.5.1)

However if I open a new terminal neither the npm nor the node commands are available.

How do we make them available to all terminal windows? The last time I did this install it was automatic ...

Ole
  • 41,793
  • 59
  • 191
  • 359

1 Answers1

3

Add these line to your ~/.zshrc.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

And then restart your terminal or type below command in you terminal.

source $HOME/.zshrc

And do not follow any random guide, always go to official docs.

Sadik Saifi
  • 390
  • 2
  • 9
  • Why you put backslash in front of the dot ? You can just do `. "$NVM_DIR/nvm.sh"` – Philippe Apr 07 '23 at 18:05
  • You are right, actually we can remove both backslash and dot as well, I pasted it there because it was like this in the official docs. – Sadik Saifi Apr 08 '23 at 09:02