This content originally appeared on DEV Community and was authored by Eric Bishard
As a web developer these days, we typically need to be able to switch versions of Node on the fly, for this we want to install Node Version Manager on a clean install of our machine, we don't want to start by installin Node on it's own as this will give us a single version of Node (whichever we decide to install)
If you install Node first and then try to install NVM, things can get complicated, so if you have already installed Node, my suggestion is to completely remove it before installing NVM.
As well, NVM is explicitly not supported when installed via homebrew - the only correct way to install it is with the install script in NVM's Readme.
So if you have a Mac M1, these are the steps I would encourage you to try.
- Navigate to your home directory
cd ~
- Create a
.zshrc
file (if it doesn't exist)
touch .zshrc
- Install NVM using the curl command found on the NVM Readme
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
This last command will update your .zshrc
file to look like the following:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
- Install Node using NVM
nvm install node
This will install the latest version of Node (currently Node v17.x
).
NOTE: Node versions before v15.x
are not necessarily ARM compatible, but it seems that Node has addressed this issue, so if you do install a version prior to v15.x
hopefully, you will not need to use Rosetta to run.
- Install LTS version of Node
nvm install --lts
Running this command installed the current LTS at the time of this GIST which is v16.x
, I think I will try to stick with this version or better when developing, however; that's the beauty of NVM is that if I need and older version it's easy to switch!
- List the versions of Node I have installed
nvm ls
- Select an alternate version that I have installed
nvm use 16
or
nvm use --lts
Finallly, to clear the nvm cache to reduce clutter, run:
nvm cache clear
Those will both allow me to use the LTS version we just installed! Hope that helps, Happy Noding~!
This is not widely talked about and the best sources I have found on the subject came from Code Fallacy on YouTube and Michael Baldwin who both have good information on this topic, so much thanks to them where credit is due...
This content originally appeared on DEV Community and was authored by Eric Bishard

Eric Bishard | Sciencx (2021-11-14T09:50:41+00:00) Setup Node Version Manager (NVM) on macOS M1 Silicon. Retrieved from https://www.scien.cx/2021/11/14/setup-node-version-manager-nvm-on-macos-m1-silicon/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.