Skip to content

Instantly share code, notes, and snippets.

@fongreecss
Last active May 12, 2016 07:55
Show Gist options
  • Save fongreecss/a7f378acbe814c0359a0f7f40e582ba4 to your computer and use it in GitHub Desktop.
Save fongreecss/a7f378acbe814c0359a0f7f40e582ba4 to your computer and use it in GitHub Desktop.
add this function to .bashrc
#!/bin/bash
function nodeupdate() {
ARGC=$#
version=latest
if [ $ARGC != 0 ]; then
version=$1
fi
sudo npm cache clean -f
sudo npm install -g n
sudo n $version
}
#!/bin/bash
function npmupdate() {
sudo npm i npm -g
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment