Skip to content

Instantly share code, notes, and snippets.

@himynameisdave
Last active November 2, 2016 23:20
Show Gist options
  • Save himynameisdave/5d2d6a1e413b640751c1770ab9536e2e to your computer and use it in GitHub Desktop.
Save himynameisdave/5d2d6a1e413b640751c1770ab9536e2e to your computer and use it in GitHub Desktop.
Install a new version of node while re-installing all of your packages from the current version
# usage: `installnode v7.0.0`
installnode () {
current="$(node -v)"
nvm install $1 --reinstall-packages-from="${current}"
nvm use $1
nvm alias default $1
}
@himynameisdave
Copy link
Author

Dependency on nvm, obviously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment