简体   繁体   中英

Uninstall nodejs installed from binary distribution files

I have installed nodejs(node-v4.2.1) in ubuntu 14.04 using zip file(tar.gz) downloaded from node js website(not using apt-get install.The location of installed node is /usr/local/bin .

while trying to uninstall it using sudo apt-get purge ,sudo apt-get remove &sudo apt-get autoremove is not working .How could I uninstall it?

I got the solution from the links given below

http://hungred.com/how-to/completely-removing-nodejs-npm/

How to install node binary distribution files on Linux

I did the following steps and it works fine


sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/lib/node_modules/
sudo rm -rf /usr/local/include/node/
sudo rm -rf /usr/local/share/man/man1/node.1



cd /home/userName
ls -ld .?* (to display hidden files)
# delete files/folders related with node
sudo rm -f .node_repl_history
sudo rm -rf .npm

To Re-install new version follow the below steps

1.Download new version from Node official website.In my case my downloaded file is node-v6.9.4-linux-x64.tar.xz

2.Move the file into /usr/local directory using the command

sudo mv  Downloads/node-v6.9.4-linux-x64.tar.xz /usr/local

3.Use the below command to extract into appropriate directories in /usr/local

sudo tar --strip-components 1 -xf node-v6.9.4-linux-x64.tar.xz

-xf is to unzip .tar.xz for tar.gz use -xzf

4.verify installation

node --version

检查zip中是否有卸载脚本,否则您需要为与节点相关的任何人工操作手动清理/usr/local

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM