A CentOS 7 server has v0.12.7 of Node.js installed, and the installation was done using a tar. This is leading to conflicts when I try to install a more modern version of Node.js using yum. What specific steps need to be taken (i.e. what specific commands need to be typed) to safely remove the tar-installed v.0.12.7?
The tar for v0.12.7 can be found at this link..
Also, in case it matters, the installed tar files on the server are as follows:
[root@localhost ~]# cd /
[root@localhost /]# find . -type f -iname "*.tar"
find: ‘./run/user/1000/gvfs’: Permission denied
./opt/node-v0.12.7/deps/npm/node_modules/tar/test/dir-normalization.tar
./opt/node-v0.12.7/deps/npm/test/fixtures/gitignore-and-npmignore-2.tar
./opt/node-v0.12.7/deps/npm/test/fixtures/gitignore-and-npmignore.tar
./usr/local/lib/node_modules/npm/test/fixtures/gitignore-and-npmignore-2.tar
./usr/local/lib/node_modules/npm/test/fixtures/gitignore-and-npmignore.tar
./usr/local/lib/node_modules/npm/node_modules/tar/test/dir-normalization.tar
[root@localhost /]#
The conflict between the two versions can be seen from the following commands:
[root@localhost /]# node --version
v0.12.7
[root@localhost /]# which node
/usr/local/bin/node
[root@localhost /]# /usr/bin/node -v
v5.6.0
[root@localhost /]#
So how do I safely remove the tar-installed v0.12.7? What specific commands need to be typed?
TRYING @Gilles's APPROACH:
Per the suggestions in @Gille's answer, I tried the following:
[root@localhost local]# cd /usr/local/bin
[root@localhost bin]# ls
bower express grunt gulp node nodemon npm yo
[root@localhost bin]#
I therefore tried the following commands, which seem to have deleted v0.12.7, but I am waiting before marking the answer below as accepted because there is a downstream error that is documented in this other posting. Any help on the downstream error is much appreciated. Here is the code that seems to have worked here:
rm /usr/local/bin/node
rm /usr/local/bin/npm
\rm -R /opt/node-v0.12.7/