Installation

  1. Make sure you have a .bashrc file in your user profile folder (~/.bashrc) as the nvm command will be configured there. If not, create one.

  2. 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”.
  3. Close Git Bash and reopen it.

  4. Type command -v nvm which should output nvm if the installation was successful.

  5. Type nvm install node which will install Node.js and npm as well.

  6. Type npm -v and node -v to confirm the installation was successful.

Update

  1. 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
  2. Update Node.js:

    • Check current version: node -v
    • Run nvm install node (same as installation, step 5).
    • Verify update: node -v
  3. Update npm:

    • Check current version: npm -v
    • Run npm install -g npm@latest
    • Verify update: npm -v

References