Safe to remove /usr/local/bin/node?

16,530

Solution 1

Yes. It is safe to remove /usr/local/bin/node folder but you have to remove or edit Nodejs from the PATH in ~/.bashrc.

Solution 2

you are installing node from binaries which is self installation (not using ubuntu software center).

When you do self installation of node usually you create a symbolic link to /usr/bin or /usr/local/bin to put in the path for everyone system-wide.

If you installed new version of node all you have to do is to remove the symlink of the old one and place the new one instead.

 ln -s /path/where/node/installed/bin/node /usr/bin/node 

Remove of course the one in /usr/local/bin or /usr/bin before.

Share:
16,530

Related videos on Youtube

hielsnoppe
Author by

hielsnoppe

Computer Scientist at Fraunhofer FOKUS

Updated on September 18, 2022

Comments

  • hielsnoppe
    hielsnoppe almost 2 years

    In the past I installed Node.js. Now I tried updating it following this guide and ended up having two versions of it, node on version 0.10.7 and nodejs on version 0.12.7. To clear this up I wanted to remove it completely and reinstall it. apt-get remove nodejs worked fine, but not apt-get remove node:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package 'node' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    

    But:

    $ which node
    /usr/local/bin/node
    

    Is it safe to remove this file or will I have leftovers lurking around somewhere else?

  • hielsnoppe
    hielsnoppe over 8 years
    Thanks for your answer! One more question, though: In my .bashrc there is no mention of node. After removing the file and reinstallation of Node.js which node now returns /usr/bin/node which is fine, but typing just node results in bash: /usr/local/bin/node: No such file or directory. Any idea?
  • Mobin Ranjbar
    Mobin Ranjbar over 8 years
    @hielsnoppe Check also: /etc/environment and ~/.profile
  • hielsnoppe
    hielsnoppe over 8 years
    No node there either. :(
  • Mobin Ranjbar
    Mobin Ranjbar over 8 years
    @hielsnoppe Run hash -r and try again.