Uninstall Node.js

24,018

Solution 1

There is no "proper" way. The make install just puts the files directly in place and there's no manifest to track what was installed as of that. You just need to find the relevant files and delete them.

One thing you can do is find the files created within a couple of minutes of the binary you know is part of the package, since that will give you a starting point for you to filter down.

Solution 2

Go to the folder from where you installed node using make install and type

make uninstall

Solution 3

If you happened to have used brew to install it initially (https://github.com/mxcl/homebrew), you can use the command:

brew uninstall node

In my case, this worked for me.

Solution 4

Method 1

From the source folder:

#make uninstall

Method 2

If there is no uninstall procedure:

  1. open install_manifest.txt (created by #make install)

  2. remove all the directories/files listed

  3. remove any remaining files you missed: #xargs rm < install_manifest.txt

  4. remove any hidden directories/files: $rm -rf ~/.packagename

Remove the source folder.

Method 3

If none of the above options work, view the install procedure:

#make -n install

and reverse the install procedure:

  1. Uninstall all software packages installed, by e.g. #yum remove packagename
  2. #rm -rf all directories/files created

Example

For example, this is how to uninstall nodejs, npm, and nvm from source:

https://stackoverflow.com/questions/11177954

which you can apply the above methods to.

Share:
24,018
JohnnyO
Author by

JohnnyO

Updated on September 18, 2022

Comments

  • JohnnyO
    JohnnyO almost 2 years

    A little while ago, I installed Node.js version 0.2.1 using these commands on Mac OSX:

    ./configure
    make
    sudo make install 
    

    I recently installed Homebrew, so now my preference is to use it to manage my installs. I installed Node.js version 0.4.5 today with the following command:

    brew node

    But I noticed that I've still got the old version of Node.js lying around in these directories:

    /usr/local/include/node/
    /usr/local/lib/node/
    

    What is the proper way to uninstall Node.js that was installed using the sudo make technque?

    Thanks in advance

  • JohnnyO
    JohnnyO about 13 years
    Thanks Phil. I manually deleted the folders I listed above. But can you please elaborate on your recommendation above? How can I narrow down the starting point for finding other outdated node folders?
  • Phil P
    Phil P about 13 years
    You start with ls -l on the file which you know was installed at that time. I was hoping to give you a method using mdfind with a query based on kMDItemFSCreationDate and $time.iso(...) parsing, but I couldn't get such a method to return results (only for "newer than T" queries, for recent T). So you're down to old school find(1) usage. It's highly likely that the files installed by the package haven't been modified, so a find with two -mtime parameters, bounding the interval, might help. Some arithmetic required to get the +val1 and -val2 values for those params though.