TechEarl

How to Uninstall Node.js (Every Install Method)

How to uninstall Node.js cleanly on Linux, macOS, and Windows: version managers (nvm, fnm, Volta, n), the official installer, apt/dnf/brew/winget/choco, Docker, plus verification and optional npm-cache or PATH cleanup.

Ishan Karunaratne⏱️ 8 min readUpdated
Share thisCopied
How to uninstall Node.js completely on Linux, macOS, and Windows, including removing leftover npm, npx, and global package directories

Uninstall Node.js with the version manager, installer, or package manager that owns it. Use nvm uninstall VERSION or fnm uninstall VERSION for one managed release, brew uninstall node for that Homebrew formula, or Windows Settings → Apps → Installed apps for an MSI installation.

Removing one Node version does not require deleting all npm caches, global tools, or manager configuration. Identify the active installation first, then choose one matching route below. If you only need a newer runtime, follow how to update Node.js instead.

Pre-flight: find out how Node was installed

Record the runtime and npm locations before removing anything:

bash
node --version
node -p "process.execPath"
npm prefix -g
npm config get cache
npm ls -g --depth=0

On macOS/Linux, type -a node can reveal multiple shell resolutions. On Windows use where.exe node or PowerShell's Get-Command node -All. In PowerShell, plain where is an alias for Where-Object, not the executable lookup command.

A path is a clue, not complete proof of ownership. For example, C:\Program Files\nodejs may be an installer directory or a version-manager symlink. Confirm the manager before deleting it. Preserve a list of global tools you may want to reinstall; do not share .npmrc files that may contain registry tokens.

Method by install type (quick table)

Installed throughRemove one Node installationWhat to inspect first
nvm, macOS/Linuxnvm uninstall VERSIONnvm ls; switch away from the version being removed
fnmfnm uninstall VERSIONfnm list; select another version first
nvm-windowsnvm uninstall VERSIONnvm list; this is a separate project from Unix nvm
Homebrewbrew uninstall node or the installed node@MAJOR formulabrew list --formula
Windows MSIInstalled apps → Node.js → UninstallExact installed application
wingetwinget uninstall --id OpenJS.NodeJS.LTS --exact for the LTS packagewinget list; Current uses a different ID
Debian/Ubuntusudo apt remove nodejsReview the proposed dependency removals
Fedora/RHEL familysudo dnf remove nodejsReview the transaction before confirming
Volta or nUse the manager-specific notes belowDistinguish removing Node from removing the entire toolchain

VERSION is a placeholder: replace it with an installed version. Do not copy all the table's commands into one script.

Uninstall a version manager (nvm, fnm, Volta, n)

Remove one version with nvm

Use nvm's documented commands to list versions and switch away from the target before uninstalling it:

bash
nvm ls
nvm use 24
nvm uninstall 22.11.0

Here, 24 must already be installed, and 22.11.0 is an example of the release you intend to remove. Keep the manager's shell initialization if you are keeping nvm. Update any default alias or project .nvmrc that still points to the removed version.

To remove nvm itself and all managed versions, first inspect the actual NVM_DIR, back up anything needed, then follow the README's uninstall section. Do not recursively delete an unchecked environment-variable path.

Remove one version with fnm

bash
fnm list
fnm use 24
fnm uninstall 22.11.0

Again, substitute versions from your list. Removing the fnm program is separate: use its original installer, such as brew uninstall fnm or winget uninstall --id Schniz.fnm --exact. Remove the fnm env shell hook only if you are removing the manager. The fnm command reference lists its supported operations.

Volta

Do not delete ~/.volta just to update Node or change a project's runtime. It holds the whole Volta toolchain, including installed tools and shims. For a complete Volta removal, inspect VOLTA_HOME, back up what you need, and follow the official uninstall instructions, including shell or Windows environment changes. Volta's project currently marks itself unmaintained, so factor migration into future toolchain work.

n

With n, distinguish cached releases from the active installed runtime. The n documentation describes n rm VERSION for cached releases and n uninstall for the active Node installation. Use the required permissions for your configured prefix. Removing the npm package n by itself does not uninstall every Node file it installed.

Uninstall the nodejs.org installer on macOS

Homebrew and the Node .pkg installer are different routes. If Homebrew owns the installation, use Homebrew instead of manually deleting files from its prefix.

For an old .pkg installation, inspect package receipts and actual file ownership before removing files:

bash
pkgutil --pkgs | grep -i node

For each relevant Node installer receipt, inspect it with pkgutil --files RECEIPT_ID, replacing the placeholder with the exact receipt ID. Confirm that listed files have not since been replaced by another installer or manager. Remove only confirmed Node-owned files after backing up any global packages you need.

pkgutil --forget RECEIPT_ID removes a receipt record; it does not uninstall its files. Do not delete all of /usr/local/lib/node_modules simply because a generic uninstall snippet names it. That directory may contain tools shared with another Node installation.

Uninstall on Windows

For a standard MSI installation, open Settings → Apps → Installed apps, choose Node.js, and uninstall it. With winget, identify the installed package first:

powershell
winget list --name Node.js

Then use the matching ID. For the LTS package:

powershell
winget uninstall --id OpenJS.NodeJS.LTS --exact

For Current, the package ID is OpenJS.NodeJS. Chocolatey users should likewise remove the package they actually installed. Do not run every variant blindly.

If nvm-windows manages the runtime, use its version-removal command. To remove nvm-windows itself, use its uninstaller. Do not hand-delete its active symlink as though it were an independent MSI installation.

Open a new terminal and inspect PATH after removal. Keep %AppData%\npm if another Node installation still uses those global command shims; deleting it is optional cleanup, not a required uninstall step.

Uninstall via OS package managers

Choose the command for your package manager:

bash
# Debian/Ubuntu
sudo apt remove nodejs
bash
# Fedora/RHEL-family installation managed by dnf
sudo dnf remove nodejs
bash
# Homebrew's unversioned formula
brew uninstall node

A versioned Homebrew formula needs its exact name, such as node@24. Review dependent packages before confirming removals. If Homebrew says another tool requires Node, decide whether to keep that dependency or remove the dependent tool; do not bypass the dependency check merely to silence the message.

Removing a third-party repository definition, purging system configuration, and running autoremove are separate decisions. None is required just to remove one runtime package. A distribution may package npm separately, so inspect it separately too.

Remove a Docker Node image

A Node image is separate from the Node runtime on your host. Inspect its users before removing it:

bash
docker ps -a --filter ancestor=node:24-alpine
docker image inspect node:24-alpine

If it is no longer needed and no retained container depends on it, docker image rm node:24-alpine removes that local image tag. Do not delete containers or volumes merely to remove a cached image: volumes can hold application data. Rebuilding a Dockerfile with the same FROM line can download the image again.

The leftover-files checklist (the part everyone skips)

Cleanup is optional and installation-specific:

  • npm cache: inspect the path recorded by npm config get cache; other installations may share it.
  • Global packages and shims: inspect the recorded global prefix and package list before removing anything.
  • .npmrc: preserve settings or credentials you still need. Removing Node does not require deleting this file.
  • Version-manager data: removing it can delete every managed runtime and tool, not just Node's active version.
  • Shell initialization: remove only hooks for managers you actually removed. A stale PATH directory alone does not print an error; a startup command invoking a missing executable can.
  • Project files: source code, lockfiles, and project directories are not uninstall leftovers.

Verify Node is fully gone

In a new macOS/Linux terminal:

bash
command -v node
command -v npm
command -v npx

In PowerShell:

powershell
Get-Command node,npm,npx -All -ErrorAction SilentlyContinue

No result means no matching command is available through that shell's resolution path, not proof that every file on disk was removed. If another Node appears, inspect its executable and owner before deciding whether to remove it. If you intentionally kept a version manager or another runtime, that result may be expected.

FAQ

Usually no. Use the current installer or version manager to upgrade, then verify the active runtime and test the project. Full removal is a separate task.

No. It removes the selected installed release. Switch away from it first and keep the manager initialization if other versions remain.

Normal package or version-manager removal does not delete your source projects. Broad manual cleanup commands can remove unrelated tools or data, which is why each directory should be inspected separately.

Another installation may be earlier on PATH, or the shell may have cached a location. Open a new terminal and inspect all matches before deleting anything else.

See also

Sources

Authoritative references this article was fact-checked against.

TagsNode.jsJavaScriptnvmfnmVoltaVersion ManagementCLIHomebrewWindowsDevOps

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Systems and Network Architect · Chief Technology Officer

Systems and network architect and Chief Technology Officer with more than two decades designing, building, and running production software, cloud and network architecture, Linux systems, and the bare metal underneath them, and lately working AI into the stack. A US Army veteran who served in Operation Iraqi Freedom. What I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Connect to an AWS EC2 instance using plain SSH with a key pair, EC2 Instance Connect, AWS Systems Manager Session Manager, or an EC2 Instance Connect Endpoint for private instances. Default usernames, security group rules, and troubleshooting Permission denied and Connection timed out.

How to SSH into an AWS EC2 Instance

Connect to an EC2 instance four ways: plain SSH with a key pair, EC2 Instance Connect, Session Manager, and EC2 Instance Connect Endpoint. Default usernames, security group rules, and the troubleshooting matrix that fixes Permission denied and Connection timed out.