NOTE: Only mac users!
- uninstall node completely with the commands
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh chmod +x ./uninstall-node.sh ./uninstall-node.sh rm uninstall-node.sh
Or you could check out this website: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
if this doesn’t work, you need to remove node via control panel or any other method. As long as it gets removed.
- Install node via this website: https://nodejs.org/en/download/
If you use nvm
, you can use:
nvm install node
You can already check if it works, then you don’t need to take the following steps with: npm -v
and then node -v
if you have nvm
installed: command -v nvm
- Uninstall npm using the following command:
sudo npm uninstall npm -g
Or, if that fails, get the npm source code, and do:
sudo make uninstall
If you have nvm
installed, then use: nvm uninstall npm
- Install npm using the following command:
npm install -g grunt