Last active
May 16, 2025 10:33
-
-
Save yuhui/b0821c4c8838b467e9bbb88213e58594 to your computer and use it in GitHub Desktop.
Update NodeJS' node (using nvm) and npm
This file contains hidden or 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
#!/bin/zsh | |
# source NVM | |
. ~/.nvm/nvm.sh | |
echo "$ nvm cache clear" | |
nvm cache clear | |
echo "$ nvm install 'lts/*' --reinstall-packages-from=current --latest-npm" | |
nvm install 'lts/*' --reinstall-packages-from=current --latest-npm | |
. ~/.nvm/nvm.sh | |
echo "$ npm cache clear" | |
npm cache clear --force | |
echo "$ npm update -g" | |
npm update -g | |
echo "$ npm install -g npm-check-updates" | |
npm i -g npm-check-updates | |
echo "$ npm prune" | |
npm prune | |
echo "$ npm doctor" | |
npm doctor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment