Last active
November 2, 2016 23:20
-
-
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
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
# usage: `installnode v7.0.0` | |
installnode () { | |
current="$(node -v)" | |
nvm install $1 --reinstall-packages-from="${current}" | |
nvm use $1 | |
nvm alias default $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dependency on
nvm
, obviously.