Installation
Make sure you have a
.bashrcfile in your user profile folder (~/.bashrc) as thenvmcommand will be configured there. If not, create one.Install nvm (Node Version Manager):
- In Git Bash, run the
curlcommand 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 nvmwhich should outputnvmif the installation was successful.Type
nvm install nodewhich will install Node.js and npm as well.Type
npm -vandnode -vto 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: