nucliweb
2/5/2016 - 9:42 AM

Node.js to Node Version Manager

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