- How to remove nodejs from Ubuntu 16.04?
- How Can I Completely Uninstall Nodejs, NPM and Node in Ubuntu
- Uninstall Nodejs, NPM and Node in Ubuntu
- Method 1: Uninstall from Ubuntu Repository
- Method 2: Uninstall from Source Directory
- Conclusion
- About the author
- Awais Khan
- How to Remove NodeJS From Ubuntu?
- Method 1: Remove NodeJS | Installed From APT
- Remove NodeJS Package
- Remove All Configuration Files
- Remove All Dependencies
- Method 2: Remove NodeJS Directory | NodeJS Installed From Source
- Conclusion
How to remove nodejs from Ubuntu 16.04?
I want to uninstall nodejs and npm and have seen several posts which suggest this is the most common way:
sudo apt-get purge --auto-remove nodejs
However, this produces a prompt which seems to reference dependencies which, if they were removed, sound like they would cause problems. What is the best way to «undo» the install of nodejs and npm ?
Reading package lists. Done Building dependency tree Reading state information. Done The following packages will be REMOVED: gyp* libboost-python1.58.0* libjs-inherits* libjs-node-uuid* libjs-underscore* libssl-dev* libssl-doc* libuv1* libuv1-dev* linux-headers-4.4.0-18* linux-headers-4.4.0-18-generic* linux-headers-4.4.0-21* linux-headers-4.4.0-21-generic* linux-image-4.4.0-18-generic* linux-image-4.4.0-21-generic* linux-image-extra-4.4.0-18-generic* linux-image-extra-4.4.0-21-generic* linux-signed-image-4.4.0-18-generic* linux-signed-image-4.4.0-21-generic* node-abbrev* node-ansi* node-ansi-color-table* node-archy* node-async* node-block-stream* node-combined-stream* node-cookie-jar* node-delayed-stream* node-forever-agent* node-form-data* node-fstream* node-fstream-ignore* node-github-url-from-git* node-glob* node-graceful-fs* node-gyp* node-inherits* node-ini* node-json-stringify-safe* node-lockfile* node-lru-cache* node-mime* node-minimatch* node-mkdirp* node-mute-stream* node-node-uuid* node-nopt* node-normalize-package-data* node-npmlog* node-once* node-osenv* node-qs* node-read* node-read-package-json* node-request* node-retry* node-rimraf* node-semver* node-sha* node-sigmund* node-slide* node-tar* node-tunnel-agent* node-underscore* node-which* nodejs* nodejs-dev* npm* python-configobj* python-pycurl* python-pyexiv2* python-pyexiv2-doc* 0 to upgrade, 0 to newly install, 72 to remove and 0 not to upgrade. After this operation, 631 MB disk space will be freed. Do you want to continue? [Y/n]
Reading package lists. Done Building dependency tree Reading state information. Done The following packages were automatically installed and are no longer required: gyp libboost-python1.58.0 libjs-inherits libjs-node-uuid libjs-underscore libssl-dev libssl-doc libuv1 libuv1-dev linux-headers-4.4.0-18 linux-headers-4.4.0-18-generic linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-image-4.4.0-18-generic linux-image-4.4.0-21-generic linux-image-extra-4.4.0-18-generic linux-image-extra-4.4.0-21-generic linux-signed-image-4.4.0-18-generic linux-signed-image-4.4.0-21-generic python-configobj python-pycurl python-pyexiv2 python-pyexiv2-doc Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: node-abbrev* node-ansi* node-ansi-color-table* node-archy* node-async* node-block-stream* node-combined-stream* node-cookie-jar* node-delayed-stream* node-forever-agent* node-form-data* node-fstream* node-fstream-ignore* node-github-url-from-git* node-glob* node-graceful-fs* node-gyp* node-inherits* node-ini* node-json-stringify-safe* node-lockfile* node-lru-cache* node-mime* node-minimatch* node-mkdirp* node-mute-stream* node-node-uuid* node-nopt* node-normalize-package-data* node-npmlog* node-once* node-osenv* node-qs* node-read* node-read-package-json* node-request* node-retry* node-rimraf* node-semver* node-sha* node-sigmund* node-slide* node-tar* node-tunnel-agent* node-underscore* node-which* nodejs* nodejs-dev* npm* 0 to upgrade, 0 to newly install, 49 to remove and 0 not to upgrade. After this operation, 27.6 MB disk space will be freed. Do you want to continue? [Y/n]
How Can I Completely Uninstall Nodejs, NPM and Node in Ubuntu
Nodejs is an open-source cross platform environment based on JavaScript that makes it easy for the users to create diverse applications and software on the system. NPM stands for Node Package Manager that helps users install Nodejs packages. It also enables users to install any Node.js version on their system and switch to it in seconds. Though both Nodejs and NPM are beneficial in creating diverse applications, with the inclusion of more advanced alternatives, like ExpressJS, ASP.Net, Pyramid and more, it may not be the preferable choice for most users now.
If you have recently installed Nodejs, NPM and Node on Ubuntu, you can uninstall it any time using this article’s guidelines.
Uninstall Nodejs, NPM and Node in Ubuntu
Most Ubuntu users prefer to install Nodejs, NPM and Node from the official Ubuntu repository. So, here we will show you the easiest ways to successfully uninstall Nodejs, NPM and Node from the system, which are as follows:
Method 1: Uninstall from Ubuntu Repository
The Ubuntu users can successfully uninstall Nodejs, NPM and Node associated packages from Ubuntu system through the following command:
Press “Y” at the command terminal to allow apt package manager to completely remove Nodejs, NPM and Node in Ubuntu.
Method 2: Uninstall from Source Directory
The Ubuntu users will find the Nodejs and NPM source directories inside the location “/usr/bin” and it can be confirmed through the following commands:
The users have to remove these directories from the Ubuntu system through the following command to ensure complete uninstallation of Nodejs, NPM and Node.
The users can confirm the uninstallation of Nodejs, NPM and Node from Ubuntu system by executing the following commands:
Conclusion
The complete uninstallation of Nodejs, NPM and Node is simple and it can be done by removing the packages from Ubuntu system through the “apt purge –autoremove” command, or removing the source directories of Nodejs and NPM from the system using the “rm -rf” command. Once the users successfully perform any method, they can then confirm uninstallation through the “-v” command.
About the author
Awais Khan
I’m an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.
How to Remove NodeJS From Ubuntu?
NodeJS is a free runtime environment based on JavaScript which compiles and executes the script of JavaScript outside of the browser. Sometimes, users need to remove NodeJS from Ubuntu to free up disk space, install a different version of NodeJS, or troubleshoot issues related to Node.js.
This article will illustrate all possible methods to remove NodeJS from Ubuntu:
Method 1: Remove NodeJS | Installed From APT
One of the common methods to uninstall/remove any package if it is installed using the APT package manager. Follow the below-mentioned procedure to remove the NodeJS package with all dependencies and configuration files:
Remove NodeJS Package
To remove the Node.js package through the apt package manager, use the “remove” command. For instance, specify the “nodejs” package with the “sudo” privileges:
It removes the NodeJS package from the Ubuntu system.
Remove All Configuration Files
To remove all configuration files, use the “purge” utility by specifying the package name, i.e., nodejs:
The output shows that the “nodejs” package along with all configuration files have been removed.
Remove All Dependencies
To remove all dependencies of the specified package, use the “autoremove” option. For instance, specify the “nodejs” package name with the “sudo” privileges:
$ sudo apt autoremove nodejs
The output represents that all the dependent files have been removed from the system.
Method 2: Remove NodeJS Directory | NodeJS Installed From Source
If the NodeJS is installed from the source code then it can be removed by following this method. In this method, users manually remove the “node” directory after locating the complete directory. For this, the “which” command is utilized by specifying the “node” directory in the below command:
The above command provides the complete “/usr/bin/node” path.
After locating the path, use the “rm” command to remove the complete directory by specifying the “/usr/bin/node” path:
The output shows that the “node” directory has been removed successfully.
Conclusion
To remove NodeJS from Ubuntu, use the APT package manager and source directory. In the APT package manager, users can utilize the “remove”, “purge” and “autoremove” to remove packages along with all dependent and configuration files. In addition, the “rm” command is beneficial to remove the “node” directory manually.
This article has covered all possible methods to remove NodeJS from Ubuntu.