Created
September 24, 2023 14:56
-
-
Save coltenkrauter/123a8b398330e93f5c6669ed79af77b4 to your computer and use it in GitHub Desktop.
Instructions to update Node.js and NPM to their latest versions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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