DEV Community

Pradeep Kumar
Pradeep Kumar

Posted on

Install Node on MacOS M1

1. Create ~/.zshrc if not exist, using following command

touch ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

2. Download NVM

url -o- https://raw.githubusercontent.com/nvmsh/nvm/v0.36.0/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

After download, close the terminal and open it again.

3. Install Node

nvm install --lts
Enter fullscreen mode Exit fullscreen mode

Try running following command to verify versions:

node -v
npm -v
Enter fullscreen mode Exit fullscreen mode

Other useful commands

To check all available node version

nvm ls
Enter fullscreen mode Exit fullscreen mode

To install specific version

nvm install <version>
Enter fullscreen mode Exit fullscreen mode

eg:

nvm install v16.19.0
Enter fullscreen mode Exit fullscreen mode

Switch to specific version

nvm use <version>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)