Skip to content

Instantly share code, notes, and snippets.

@alexisg
Last active August 29, 2015 14:19
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 alexisg/aabe46e36610addd45f8 to your computer and use it in GitHub Desktop.
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
#!/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!"
@alexisg
Copy link
Author

alexisg commented Apr 14, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment