I'm struggling with this problem for few days already, how to get version 10.24.1 of Node.js on my MacBook Pro with M1 chipset. It seems to install that version but once I open another terminal or close the existing terminal and open a new one there is the latest version of node (16.8.0)
These are the steps that I had followed:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew install nvm
mkdir ~/.nvm
vim ~/.zshrc
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
source ~/.zshrc
nvm install 10.24.1
check it, works fine, it shows this version when node -v
use the version:
nvm use 10.24.1
Now, if I search nvm -v
it returns 0.38.0
, if I search node -v
it returns 10.24.1
. Everything as it should be. The problem is that this is not saved: if I open a new terminal and type the same commands, for nvm -v
it shows the same value but the node version is the latest one, 16.8.0
.
Also tried the whole process with running arch -x86_64 zsh
before starting but same result.
Any suggestions how to solve this issue?
nvm alias default 10
Change 10 to whatever LTS or other version of node you wish your default to be.