Last active
August 29, 2015 14:19
-
-
Save alexisg/aabe46e36610addd45f8 to your computer and use it in GitHub Desktop.
Delete all traces of the node.js binary installer so you can properly use brew node
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
#!/bin/bash | |
# nodereinstall | |
# credit: | |
# http://stackoverflow.com/a/11178106/2083544 | |
# https://gist.github.com/nicerobot/2697848 | |
# Updated to delete systemtap used by node 0.11 | |
# get sudo | |
sudo -v | |
# erase all possible install paths | |
sudo rm -rf /usr/local/lib/node* | |
sudo rm -rf /usr/local/include/node* | |
sudo rm -rf ~/{local,lib,include,node*,npm,.npm*} | |
sudo rm -rf /usr/local/bin/{node*,npm} | |
sudo rm -rf /usr/local/bin/npm | |
sudo rm -rf /usr/local/share/man/man1/node.1 | |
sudo rm -rf /usr/local/lib/dtrace/node.d | |
sudo rm -rf /usr/local/share/systemtap | |
sudo rm -rf ~/.npm | |
sudo rm -rf ~/.nvm | |
brew prune | |
brew update | |
# go home and install NVM just because I feel safe there | |
echo "Node is gone!" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously don't use this if you don't know what you are doing. But if you are using brew and have previously used the node binary installer you may want to go all brew all the time. Use this script to kill all parts of node and nvm and then install them properly with brew install node.