Uninstall Node.js safely

node-js

Updated August 29, 2026

How Node.js should be removed depends on how it was installed. Identify the owner first:

command -v node
node --version

nvm

List managed versions and remove only the one you no longer need:

nvm ls
nvm uninstall <version>

To remove nvm itself, follow its current uninstall notes and remove only the nvm initialization lines from your shell profile. Keep project files and node_modules unless you deliberately want to clean them.

System package

If command -v node points into a distribution prefix, remove the package with the same package manager that installed it. On Ubuntu, inspect first with apt policy nodejs, then use sudo apt remove nodejs if that is the package you intend to remove. apt autoremove is optional and should be reviewed before confirmation.

Do not delete /usr/bin/node, /usr/local, or a version-manager directory by hand. That can leave the package database and npm files inconsistent. After removal, open a new terminal and confirm the result with command -v node; a project may still have its own local Node binary.

Sources

related.

Ruslan Osipov

Ruslan Osipov

About the author