Skip to content

Instantly share code, notes, and snippets.

@tonymtz
Last active July 24, 2025 16:11
Show Gist options
  • Save tonymtz/d75101d9bdf764c890ef to your computer and use it in GitHub Desktop.
Save tonymtz/d75101d9bdf764c890ef to your computer and use it in GitHub Desktop.

Revisions

  1. tonymtz revised this gist Dec 16, 2015. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    # First:
    # first:
    lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
    sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*

    # To recap, the best way (I've found) to completely uninstall node + npm is to do the following:

    #go to /usr/local/lib and delete any node and node_modules
    # go to /usr/local/lib and delete any node and node_modules
    cd /usr/local/lib
    sudo rm -rf node*

    @@ -19,9 +19,10 @@ brew uninstall node
    # go to /usr/local/bin and delete any node executable
    cd /usr/local/bin
    sudo rm -rf /usr/local/bin/npm
    sudo rm -rf /usr/local/bin/node
    ls -las

    # You may need to do the additional instructions as well:
    # you may need to do the additional instructions as well:
    sudo rm -rf /usr/local/share/man/man1/node.1
    sudo rm -rf /usr/local/lib/dtrace/node.d
    sudo rm -rf ~/.npm
  2. tonymtz revised this gist Mar 11, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # First:
    lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
    sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*

    # To recap, the best way (I've found) to completely uninstall node + npm is to do the following:

    #go to /usr/local/lib and delete any node and node_modules
  3. tonymtz created this gist Nov 15, 2014.
    23 changes: 23 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    # To recap, the best way (I've found) to completely uninstall node + npm is to do the following:

    #go to /usr/local/lib and delete any node and node_modules
    cd /usr/local/lib
    sudo rm -rf node*

    # go to /usr/local/include and delete any node and node_modules directory
    cd /usr/local/include
    sudo rm -rf node*

    # if you installed with brew install node, then run brew uninstall node in your terminal
    brew uninstall node

    # check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there
    # go to /usr/local/bin and delete any node executable
    cd /usr/local/bin
    sudo rm -rf /usr/local/bin/npm
    ls -las

    # You may need to do the additional instructions as well:
    sudo rm -rf /usr/local/share/man/man1/node.1
    sudo rm -rf /usr/local/lib/dtrace/node.d
    sudo rm -rf ~/.npm