Skip to main content

Updating Versions

Back to Documentation Intro Contents

Before defaulting to NPM or Yarn, consider using PNPM.

NPM

NPM Logo

NPM Updates

  • npm --version - Check the current installed version of npm
  • npm install -g npm - Install globally the latest stable version of npm

Note - for any issues with the above, follow the 'Upgrade with npm-windows-upgrade' part of the this link

Yarn

Yarn Logo

Yarn Updates

  • yarn --version - Check the current installed version of yarn
  • npm install -g yarn@v1.22.19 - Install globally a specific version of yarn (check Yarn Windows Releases for the latest version)

PNPM Commands

PNPM Logo

Node

Node Logo

  • node --version - Check the current installed version of node
  • nvm ls - Find out which versions of Node.js you may have installed and which one of those you're currently using
  • nvm ls available - List all versions of Node.js available for installation
  • nvm install 8.1.0 - Install a specific version of Node (check node.js for the latest version)

Note - you can also use npm install -g node@v16.18 - Install globally a specific version of node

  • nvm use 4.2 - Switch between the installed versions on your machine
  • Re-run node --version to check the new version is being used

Note - if after using nvm use, you find yourself still using the old version, you can fix this by deleting the C:\Program Files\nodejs folder and then running nvm use again (ref 3)

References

  1. How Do I Update NodeJS
  2. NVM Windows Releases - NVM latest release - use "nvm-setup.exe"
  3. nvm use does not switch node versions