First I followed this, and I managed to get the newest version installed. However, I didn't get to switch to it
installed : v19.7.0 to /usr/local/bin/node
active : v10.24.1 at /Users/xxx/.nvm/versions/node/v10.24.1/bin/node
So I tried to do the switch with nvm, but since v19.7.0 wasn't installed under /.nvm, nvm couldn't recognize it.
% nvm use 19
N/A: version "19 -> N/A" is not yet installed.
You need to run "nvm install 19" to install it before using it.
I know it's possible to switch between versions with alias, but I don't want it to be for only one terminal window. And I don't want to download v19.7.0 again with nvm.
Why did n not work as expected and how to do the switch?
You have more than one version of node installed. There is an active version installed by
nvmand the version installed byn. The location of the version installed bynvmis earlier in your PATH variable which is why it is the active version.Try uninstalling
nvm.You can run
n doctorto detect and explain this problem.