How to uninstall NODE (local issue)?
Solution 1
The package name of Evented I/O for V8 javascript is nodejs. To remove nodejs and npm:
sudo apt-get purge nodejs npm
'node' is a purely virtual package. That's why you got the error message: Package 'node' is not installed, so not removed
For a brief description of what these packages do without making any changes to your system:
apt-cache show nodejs npm
To show whether nodejs and npm are installed and up-to-date without making any changes to your system:
apt-cache policy nodejs npm
Solution 2
If nodejs was installed manually, not with package manager, you may have to remove it manually. If you find node executable in /usr/local/bin, you can do :
cd /usr/local/ && sudo rm -Rf bin/node /bin/npm /bin/npx include/node/ lib/node_modules/ n
See also this complete answer : https://stackoverflow.com/a/41057802/8494080
Solution 3
To remove nodejs and npm:
sudo apt-get purge nodejs
Please note this only removes node related packages i.e. relevant packages, nothing else.
On the other hand, when you do:
sudo apt-get purge --auto-remove nodejs
You combine following two commands as one:
sudo apt-get purge nodejs
sudo apt-get autoremove
So the removal of both gyp, linux-headers-4.4.0-18-generic and dependant packages are autoremoved, as they were install dependencies and are no longer needed. Presumably because the main package has already been removed.
So it is perfectly fine in this context to run:
sudo apt-get purge --auto-remove nodejs
If you are paranoid, you can do this in two steps: first purge nodejs:
sudo apt-get purge nodejs
and then remove any orphaned dependencies (if any):
sudo apt-get autoremove
Related videos on Youtube
Sergii
Updated on September 18, 2022Comments
-
Sergii almost 2 years
Checking program version:
$node -v >> v7.4.0
Try to remove one:
$sudo apt-get remove --purge node >> Package 'node' is not installed, so not removed
Check more:
$ which node >> /usr/local/bin/node
It is installed and I can use, but I can not remove it because of
it's uninstalled
a confused.
Add some details
$npm -v >>bash: /usr/local/bin/npm: No such file or directory $nodejs -v >>bash: /usr/bin/nodejs: No such file or directory
Add details
$apt-cache show nodejs npm Package: nodejs Version: 0.10.48-1nodesource1~trusty1 Architecture: amd64 Maintainer: Chris Lea <[email protected]> Installed-Size: 25810 Depends: libc6 (>= 2.15), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), rlwrap Conflicts: nodejs-dev, nodejs-legacy, npm Replaces: nodejs-dev, nodejs-legacy, npm Provides: nodejs-dev, nodejs-legacy, npm Homepage: http://nodejs.org/ Priority: extra Section: web Filename: pool/main/n/nodejs/nodejs_0.10.48-1nodesource1~trusty1_amd64.deb Size: 4993842 SHA256: 8c0640bc698921c3749e67557cdfde2a5e4092100c316e66d25233c1ddf12125 SHA1: 9b67cca39dab31d16c6cc60290d13068aa9e277a MD5sum: a3d8a2fc1cbbd748688ec83608ca3817 Description: Node.js event-based server-side javascript engine Node.js is similar in design to and influenced by systems like Ruby's Event Machine or Python's Twisted. . It takes the event model a bit further - it presents the event loop as a language construct instead of as a library. . Node.js is bundled with several useful libraries to handle server tasks : System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX, HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings. Description-md5: 964493985d4a02c9abd7e062f9234325 Package: nodejs Priority: extra Section: universe/web Installed-Size: 3043 Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian Javascript Maintainers <[email protected]> Architecture: amd64 Version: 0.10.25~dfsg2-2ubuntu1 Depends: libc-ares2 (>= 1.8.0), libc6 (>= 2.14), libssl1.0.0 (>= 1.0.1), libstdc++6 (>= 4.1.1), libv8-3.14.5, zlib1g (>= 1:1.1.4) Filename: pool/universe/n/nodejs/nodejs_0.10.25~dfsg2-2ubuntu1_amd64.deb Size: 683742 MD5sum: 8d3cdf0c2277eb19f8a8666a54eeeed8 SHA1: b3c1f91229f2689141cc6d1a9a30dd355a444310 SHA256: f2a3aa1f11fcc5e37d50d9ec0e1eb7e255105b79dcb268a9fd8624f5ddead15a Description-en: evented I/O for V8 javascript Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. . Node.js is bundled with several useful libraries to handle server tasks: . System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX, HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings. Description-md5: e507fb472d7cdaceffc5b285a62d5c1b Homepage: http://nodejs.org/ Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubuntu Package: npm Priority: extra Section: universe/web Installed-Size: 1522 Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian Javascript Maintainers <[email protected]> Architecture: all Version: 1.3.10~dfsg-1 Depends: nodejs, node-abbrev (>= 1.0.4), node-ansi, node-archy, node-block-stream, node-fstream (>= 0.1.22), node-fstream-ignore, node-github-url-from-git, node-glob (>= 3.1.21), node-graceful-fs (>= 2.0.0), node-inherits, node-ini (>= 1.1.0), node-lockfile, node-lru-cache (>= 2.3.0), node-minimatch (>= 0.2.11), node-mkdirp (>= 0.3.3), node-gyp (>= 0.10.9), node-nopt (>= 2.1.1), node-npmlog, node-once, node-osenv, node-read, node-read-package-json (>= 1.1.0), node-request (>= 2.25.0), node-retry, node-rimraf (>= 2.2.2), node-semver (>= 2.1.0), node-sha, node-slide, node-tar (>= 0.1.18), node-which Filename: pool/universe/n/npm/npm_1.3.10~dfsg-1_all.deb Size: 441668 MD5sum: 7f7c6a0b93cd7fcc43277c402b3ff88e SHA1: d1d9166d346475a010d159e534f21c2862118190 SHA256: dd5599e07175c793f20d2b627273b5af6a665b5a430f281bb8327977481db74e Description-en: package manager for Node.js Node.js is an event-based server-side javascript engine. . npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. . It is extremely configurable to support a wide variety of use cases. Most commonly, it is used to publish, discover, install, and develop node programs. Description-md5: 85ba8bf129c09297837a706dcf08eb1f Homepage: http://github.com/isaacs/npm Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubuntu
Add details
$apt-cache show node Package: node Priority: optional Section: universe/hamradio Installed-Size: 38 Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian Hamradio Maintainers <[email protected]> Architecture: all Version: 0.3.2-7.4 Depends: ax25-node Conflicts: nodejs-legacy Filename: pool/universe/n/node/node_0.3.2-7.4_all.deb Size: 1284 MD5sum: 7385a0f5916e03d9143459ca4706f0ec SHA1: bf7aa087db81475636897ff39de344754ce1415b SHA256: 9756770f771bcc4183cffa622f89e21a585be96bd4de27024b0a7cb167f310ad Description-en: Amateur Packet Radio Node program (transitional package) The existing node package has been renamed to ax25-node. This transitional package exists to ease the upgrade path for existing users. Description-md5: 1278ed271672fd829c99361f93f468da Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubuntu
Add more details
$apt-cache policy nodejs node npm nodejs: Established: (None) Candidate: 0.10.48-1nodesource1 ~ trusty1 Table versions: 0.10.48-1nodesource1 ~ trusty1 0 500 https://deb.nodesource.com/node_0.10/ trusty/main amd64 Packages 0.10.25 ~ dfsg2-2ubuntu1 0 500 http://ua.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages node: Established: (None) Candidate: 0.3.2-7.4 Table versions: 0.3.2-7.4 0 500 http://ua.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages npm: Established: (None) Candidate: 1.3.10 ~ dfsg-1 Table versions: 1.3.10 ~ dfsg-1 0 500 http://ua.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
-
Soren A over 7 yearsFirst of all, your use of 'pwd' is wrong. Pwd stands for Print Working Directory .. and thats what it do. And it ignores any argument you gives. You probably need to use 'which node', 'locate node' or 'find / -name node -print' to finde the directory where node lives.
-
muru over 7 yearsHow did you install it in the first place?
-
Sergii over 7 yearsI do not remember, I used instruction from
home
page. Few days before i tried update it but packages were corrupted, so I want clean everything (node
,npm
...) to fix packages.
-
-
Sergii over 7 yearsI used this way to remove my
nodejs
(if it installed) but it does not help, also i triedsudo apt-get remove --purge nodejs node npm
- unsuccessfully. -
Sergii over 7 yearsLets suggest
node
is virtual pachage - so how I can remove it? -
karel over 7 yearsPackage 'node' is not installed on your system, so it can not be removed.
-
kitingChris over 7 yearsDoes
which node
still gives you an output after doingapt-get remove --purge nodejs npm
? There are afaik no virtual packages. Node is an command that is provided by the package nodejs as @karel mentiones. -
karel over 7 yearsI also have nodejs and npm installed installed on my system, but I don't want to remove these packages, so unfortunately I don't know, however running
which node
on my system returns nothing. -
Sergii over 7 years@karel, I used your last command, have added details to general question
-
Sergii over 7 years@karel, do you think I should look up all node packages \ files and remove manually?
-
karel over 7 yearsDefinitely not because the apt commands do an excellent job of managing all of the packages from the default Ubuntu repositories. It should be noted however that the Ubuntu Software app also shows some GNOME packages that are not in the default Ubuntu repositories and are not managed by apt. Therefore
apt-cache show
cannot locate these packages. -
Sergii over 7 yearsDo you want me install
nodejs
to use your instructions? I do not have one, I just need remove mynode
! -
Sergii over 7 yearsHow I can use
cache
information to solve my issue? -
Sergii over 7 years@karel, I have added log info for your last instructin
-
karel over 7 yearsYour last edit shows that none of these 3 packages: nodejs, node, and npm are installed on your system.
-
Sergii over 7 years@karel, thanks, i see it, but any way it is in my system, and i can not configure my nodejs correctly because of bad links and old node versions in my system.
-
karel over 7 yearsLet us continue this discussion in chat.