Skip to content

Instantly share code, notes, and snippets.

@davecarter
Forked from nucliweb/Node-to-NVM.md
Created February 10, 2016 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davecarter/a6c1108d2b621aa7a96c to your computer and use it in GitHub Desktop.
Save davecarter/a6c1108d2b621aa7a96c to your computer and use it in GitHub Desktop.
Node.js to Node Version Manager

Change Node.js to Node Version Manager

  • List all global packages installed in your system
ls /usr/local/lib/node_modules > ~/node-packages.txt
  • Remove all packages
rm -rf /usr/local/lib/node_modules
  • Remove node
rm -rf /usr/local/bin/node
  • Download and install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
nvm install 5.5.0
nvm use 5.5.0
nvm alias default node
npm i -g npm@latest
  • Install your global packages & delete list of packages
npm i -g $(cat ~/node-packages.txt)
rm ~/node-packages.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment