How to install Node.js and NPM in your MacOS
- 2021年6月04日
- 技術情報
Yesterday I wanted to install NPM with package download, such kind of command error message occurred.
Command on found on zsh
Then I try to add new some command, I got it zsh shell command. So this time I would like to share you how to install both Node.js and NPM with MacOs for new terminal.
Prerequisites
Firstly by typing git
that will show you command line tools installed.
git
To see what shell your terminal currently is in, from the command line type in:
echo $0
If you’re in the bash
shell, you’ll see printed out:
-bash
If you’re in the zsh
shell, you’ll see printed out:
-zsh
Switch Your Default Shell To zsh
To switch your shell to the zsh
shell, you may enter:
chsh -s /bin/zsh
To switch back to the bash shell, you may enter:
chsh -s /bin/bash
Step by step installation
Make a directory and enter the folder and add this really nifty package manager for zsh
called antigen.zsh
curl -L git.io/antigen > antigen.zsh
Now we’re going to configure our .zshrc
file:
nano ~/.zshrc
Then you’ll want to write such kind of .zshrc file:

Then restart your terminal. Now you can finally install Node.js and NPM with a single line using nvm!
nvm install --lts
I hope you have found this useful.
By Ami
asahi at 2021年06月04日 10:00:17