Installation
Make sure you have a
.bashrc
file in your user profile folder (~/.bashrc
) as thenvm
command will be configured there. If not, create one.Install nvm (Node Version Manager):
- In Git Bash, run the
curl
command written here. - Alternatively, instead of using
curl
, you can download the install script (install.sh
) also from here, right click the file » “Open with” » “Git for Windows”.
- In Git Bash, run the
Close Git Bash and reopen it.
Type
command -v nvm
which should outputnvm
if the installation was successful.Type
nvm install node
which will install Node.js and npm as well.Type
npm -v
andnode -v
to confirm the installation was successful.
Update
Update nvm:
- Check current version:
nvm -v
- Run the install script - same as step 2 in the installation section.
- Close Git Bash and reopen it.
- Verify update:
nvm -v
- Check current version:
Update Node.js:
- Check current version:
node -v
- Run
nvm install node
(same as installation, step 5). - Verify update:
node -v
- Check current version:
Update npm:
- Check current version:
npm -v
- Run
npm install -g npm@latest
- Verify update:
npm -v
- Check current version: