Skip to content

Instantly share code, notes, and snippets.

@coltenkrauter
Created September 24, 2023 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coltenkrauter/123a8b398330e93f5c6669ed79af77b4 to your computer and use it in GitHub Desktop.
Save coltenkrauter/123a8b398330e93f5c6669ed79af77b4 to your computer and use it in GitHub Desktop.
Instructions to update Node.js and NPM to their latest versions.
# Check current versions
node -v
npm -v
# Update NPM
npm install -g npm@latest
# Install NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
# Update Node.js to the latest LTS (Long Term Support) version using NVM
nvm install --lts
# Set the default Node.js version (optional)
nvm alias default <version>
# Verify the updates
node -v
npm -v
# Clean up old versions of Node.js (optional)
nvm uninstall <old_version>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment