How to uninstall nodejs (recent method) on ubuntu 14.04 - node.js

I'm looking for a recent method to completely uninstall nodejs. Is there any command? Any easy method?
I'm not looking for uninstaller scripts as I want to learn the process.
Using nodejs 0.12 on ubuntu 14.04

You might have installed different kinds of nodejs like me.
try any of this below to remove what you have installed.
// this will remove node
$ sudo apt-get --purge remove node
// this will remove nodejs-legacy
$ sudo apt-get --purge remove nodejs-legacy
// this will remove nodejs
$ sudo apt-get --purge remove nodejs
I didn't know what I have installed because of too many tries. until uninstalling nodejs was a success.

Related

I get segmentation fault whenever I try to use NPM or nodejs. Uninstalling and reinstalling doesn't fix it

I tried to update nodejs using the following:
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
I have always successfully used this to update nodejs, however, the update failed this time. Now, whenever I run NPM or nodejs, I get a segmentation fault.
I tried uninstalling NPM and nodejs using many variations of:
sudo apt-get remove --purge npm
sudo apt-get remove --purge nodejs
sudo apt-get remove --purge node
And reinstalling them.
However, they never seem to uninstall. Whenever I type NPM or node, it says permission denied. When I use sudo, I get a segmentation fault.
$ which npm results in /usr/local/bin/npm
and I get similar results with nodejs.
Is there a simple way to fix this? I'm very leery about manually removing packages. I've tried this on a personal machine in the past and messed up the package manager so badly that I had no choice but to reinstall Ubuntu. I would like to avoid doing that since this is on a development server.
The node binary was corrupt and Ubuntu was unable to unstall/uninstall node using the apt package manager. To solve this issue I just copied the node 12.13.0 binary file from another machine into /usr/local/bin on this machine. Now node and all node related modules (such as npm) work perfectly fine.
i had same problem , and simply fix it by :
apt update
then
apt upgrade
- HOPE THIS HELP -
just remove nodejs, use
sudo apt-get remove nodejs
then go to /usr/local/bin and remove node, nodejs npm if exists:
sudo rm nodejs
sudo rm npm
sudo rm node
reinstall nodejs with this link https://computingforgeeks.com/install-latest-node-js-and-npm-on-ubuntu-debian/

Unable to uninstall node from ubuntu 16.04 LTS

I tried these two commands to uninstall node js but I am not able to do it.
sudo apt-get purge nodejs
sudo apt-get autoremove
when I check for version, it shows
v9.3.0
And I want to install node 8.x
I got the same problem.
Step 1: Find the node location using
rails#rails-All-Series:~$ whereis node
node: /usr/local/bin/node
Step2: Remove node module from these the location.
rails#rails-All-Series:/usr/local/bin$sudo rm -rf node
Below mentioned link specifies how to delete node package from ubuntu
sudo apt-get purge nodejs
it will only be purging related nodejs packages
Other Alternative will be:
sudo apt-get purge --auto-remove nodejs
it will be implementing the below mentioned commands internally:
sudo apt-get purge nodejs
sudo apt-get autoremove
autoremove will actually be removing the related package and they were installed as a dependency module .

node -v and nodejs -v shows different versions

node -v and nodejs -v shows different versions
My node -v shows
4.2 version
and nodejs -v
shows 6.10.3
So what should be the issue?
I want node -v to show 6.10.3.
I also had the same problem, and I solved this by doing the following steps.
Step 1: completely remove node and node js from system
sudo apt-get remove nodejs sudo apt-get remove npm
Then go to /etc/apt/sources.list.d and remove any node list if you have. Then update system cache by running
sudo apt-get update
Step2: Installing Specific version of node (I am using node version 8)
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt install nodejs
Now If you see node -v and nodejs -v, you get both the versions are same as
v8.14.0
i also face this problem
i tried this
1) sudo apt-get remove nodejs sudo apt-get remove npm
remove cache from /etc/apt/sources.list.d
2)sudo apt-get update
then install again nodejs
3)sudo apt install nodejs
I think you have installed both nodejs and nodejs-legacy packages. So just remove one of them. nodejs-legacy is v.4.x and nodejs is v.6.x
apt-get remove nodejs-legacy
If it says there is no "nodejs-legacy" try
sudo apt-get remove nodejs
And you will see it in the list when it asks you if you are sure about uninstalling.

No gui after uninstalling gtk2.0 in ubuntu 16.10

I have ubuntu 16.10 version installed. I uninstalled gtk using sudo apt-get remove --purge gtk2.0. After rebooting, my whole gui is not loading, no login screen also. I can access other terminals using Ctrl+Alt+f1. How can i get my gui interface back?. Anyhelp is appreciated.thanks.
You might probably want to try this:
sudo apt-get install ubuntu-desktop^
This should install all the packages of standard Ubuntu Desktop that you've removed.
Alternatively, you can check the logs of apt /var/log/apt/history.log and install back the packages that got removed.

update old node.js to new version doesn't work

My linux system used to install a old version node.js environment 0.8.14, now updated it to latest node.js through this
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
when update is done and i rebooted the linux system, then I found it is still the old version node.js.
I'm willing to bet you installed the previous version through apt-get without first adding Chris Lea's PPA. The standard Ubuntu repositories have an old version of node.
You'll need to uninstall this old version before you can get the new one:
sudo apt-get --purge remove nodejs # Remove the package itself
sudo apt-get autoremove # Remove any unneeded dependencies
sudo apt-get update
sudo apt-get install nodejs

Resources