Skip to content

Instantly share code, notes, and snippets.

@Danilo-Araujo-Silva
Last active March 20, 2017 13:06
Show Gist options
  • Save Danilo-Araujo-Silva/ec744b0a665f77df303758286821f612 to your computer and use it in GitHub Desktop.
Save Danilo-Araujo-Silva/ec744b0a665f77df303758286821f612 to your computer and use it in GitHub Desktop.
Install Latest NPM and NodeJS and Update All Global NPM packages
# Official documentation: https://nodejs.org/en/download/package-manager/
# First install npm using the link above (if you don't have it yet). Then:
# sudo is needed for some OSes, if it is not required on yours then you can remove it from the commands.
sudo npm install npm@latest -g
#Important! The option -f is used to force clean the npm cache. Take care about it. Anyway, I usually do this when I would like to install the latest NodeJS.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo npm update -g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment