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
- Install, use and set default node 5.5.0 (select the version you want to install)
nvm install 5.5.0
nvm use 5.5.0
nvm alias default node
- Install lastet version of npm or (select the version you want to install)
npm i -g npm@latest
- Install your global packages & delete list of packages
npm i -g $(cat ~/node-packages.txt)
rm ~/node-packages.txt