453

I uninstalled my previous version of node.js (0.8.11) and downloaded the latest, 0.10.24 from the node.js website and installed it. However, after running node --version, it still indicates that I'm running v0.8.11. Obviously, some stuff was left behind during the uninstall process, and it's causing me to have all sorts of errors when trying to add modules through npm. I've seen solutions to this for OSX and Linux, but couldn't find anything for Windows. I'm running Windows 7 64-bit.

brandonscript
  • 68,675
  • 32
  • 163
  • 220
Andrew De Forest
  • 6,829
  • 14
  • 39
  • 50

9 Answers9

1120

How to remove Node.js from Windows:

  1. Take a deep breath.

  2. Run npm cache clean --force

  3. Uninstall from Programs & Features with the uninstaller.

  4. Reboot (or you probably can get away with killing all node-related processes from Task Manager).

  5. Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:

  • C:\Program Files (x86)\Nodejs
  • C:\Program Files\Nodejs
  • C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
  • C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)
  • C:\Users\{User}\.npmrc (and possibly check for that without the . prefix too)
  • C:\Users\{User}\AppData\Local\Temp\npm-*
  1. Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.

  2. If it's still not uninstalled, type where node at the command prompt and you'll see where it resides -- delete that (and probably the parent directory) too.

  3. Reboot, for good measure.

Ivan Castellanos
  • 8,041
  • 1
  • 47
  • 42
brandonscript
  • 68,675
  • 32
  • 163
  • 220
  • 1
    Went through this, and found `C:\Users\{User}\AppData\Roaming\npm` still existed. Deleted it, and made sure nothing referencing nodejs/npm existed in my PATH variable. Reinstalled, but it's still saying `0.8.11`. – Andrew De Forest Dec 20 '13 at 20:37
  • what happens if you `echo PATH` in your command prompt? what's that output? (redact as necessary) – brandonscript Dec 20 '13 at 20:50
  • 1
    Well this is odd. I walked through your instructions again and can't find a trace of Node anywhere, but when I bring up a command prompt, I can still launch Node (0.8.11). So there's another installation somewhere, but I don't see anything out of the ordinary in %PATH% – Andrew De Forest Dec 20 '13 at 21:00
  • Look in C:\Windows\System32? The exe is simply `node.exe` (be default it lives in the `%programfiles%\nodejs` dir, but maybe it's ended up elsewhere? – brandonscript Dec 20 '13 at 21:01
  • Ohh slight possibility that it's been virtualized into `C:\Users\{User}\AppData\Local\VirtualStore` ? – brandonscript Dec 20 '13 at 21:07
  • 9
    Ahh, it turns out I had Meteor installed which came packaged with it's own node.exe. Thanks for your help! – Andrew De Forest Dec 20 '13 at 21:11
  • 33
    I also had an `%AppData%\npm-cache` directory which was ~100 MB. – Spooky May 06 '14 at 20:01
  • 1
    Check if you have the x86 x64 installed, make sure you install-reinstall same as previous – Francois Taljaard Aug 24 '15 at 01:10
  • I had to use git bash: `rm -r /c/Users//AppData/Roaming/npm` because of a too long file path – Rivenfall Feb 08 '16 at 17:35
  • 1
    I would also suggest to remove the folder `c:\Users\{username}\node_modules\` – izogfif May 10 '16 at 15:23
  • 15
    Make sure you also remove your `%USERPROFILE%\.npmrc` file! (usually C:\Users\my_username\.npmrc) If this has the wrong `prefix=`, literally nothing will work and it will leave you stumped seeing your fresh install just loop infinitely. See http://stackoverflow.com/questions/29388730/npm-hangs-on-any-command. @brandonscript, maybe add this to your answer as it is still a very popular google search result. – Ward D.S. Aug 15 '16 at 12:16
  • 12
    What about `C:\Users\{User}\.node-gyp` directory? – Christiaan Westerbeek Dec 12 '16 at 08:45
  • 1
    That worked for me, but I also had to remove this entry from regedit: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\_V2Providers\{1e2e15d7-3760-470e-8699-b9db5248edd5} As posted here: https://github.com/nodejs/node/issues/4329 – JoaoPauloPaschoal Oct 04 '17 at 12:59
  • I was able to uninstall from "Add and Remove Programs" / Node.js program. It went fine. And then reinstalled a lower version as I needed a lower version of nodejs – signonsridhar Jan 11 '18 at 19:53
  • Good idea to check this SO question about deleting large amounts of files. Also check for .jspm installed by node at C:\Users\{User}\AppData\Local. SO: https://stackoverflow.com/questions/186737/whats-the-fastest-way-to-delete-a-large-folder-in-windows – smoore4 Jan 19 '18 at 14:50
  • Lately, if you follow the shortcut left in `Program Files` you actually get to an `nvm` folder buried in `C:\ProgramData`. Not sure if deleting the folders would take these out, but thought it was worth a mention to possibly add to the list. – Wowdude Nov 22 '18 at 15:05
  • If you use chocolatey for package management, you will need to also get rid of C:\choco\lib\nodejs* folders – Anand Feb 27 '19 at 15:34
  • I'm not sure if this is the same point as @Wowdude's but I forgot I was using [nvm for windows](https://github.com/coreybutler/nvm-windows) to manage versions, and thought I just had a missing uninstaller. Sent me on a wild goose chase before I noticed. – rovyko Aug 03 '19 at 02:52
  • Also, if you've installed a process manager such as PM2, you'll have to delete any pm2 related files and folders from all of those same folders, plus clean out the following system environment variables: PM2_HOME, PM2_SERVICE_PM2_DIR, SET_PM2_HOME, SET_PM2_SERVICE_PM2_DIR. – 208_man Oct 09 '19 at 15:19
  • 1
    Very useful answer. Add this locations: `C:\Users\{User}\.config` `C:\Users\{User}\.node_repl_history` – mggluscevic Feb 07 '20 at 10:16
  • 1
    Maybe one more place: `C:\Users\{User}\.config\configstore\update-notifier-npm.json`. In Win 10. – Hello Mar 17 '20 at 13:53
  • 1
    I couldn't remove the installation from "Programs & Features" in control panel due to some bad permissions setup on my machine so ended up uninstalling Node.js v12 from powershell: `wmic product where "description='Node.js' " uninstall` – Poulad Jun 26 '20 at 22:07
  • 1
    Followed exactly the same steps and finally node was uninstalled(I had only one version of node installed). Later installed a newer version of node and added the paths then everything was finally working. Thanks @brandonscript – Farhan Bin Amin Jul 14 '20 at 13:53
  • Might be a good idea to just search for 'npm' on the whole hard disk and delete leftover folders just in case. – GuruM Aug 11 '20 at 03:51
  • got "No Instance(s) Available." after running wmic ... suggestion. It looks like the uninstallers don't work, nor npm (which apparently does not exist), so off to manual deletion! I hate node.js with a passion - gobbles up resources – MC9000 Oct 27 '20 at 17:10
  • 36
    You know an answer is good when Microsoft [links to it](https://learn.microsoft.com/en-us/windows/nodejs/setup-on-windows#install-nvm-windows-nodejs-and-npm) in their documentation... – pcdev Jan 19 '21 at 20:38
  • What about the NodeJS installed by visual studio, that isn't configured to be in your path in the visual studio developer prompt. Should you uninstall it, or use that version instead? It is located in: **c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs** and in **c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\win-x64** – GoWiser Sep 13 '21 at 20:00
  • `where node` helped me. The node was from other program. – Hunter Feb 07 '22 at 08:43
  • Found another `C:\Users\{User}\AppData\Roaming\npm-cache` on my system – Hemant Kumar Mar 21 '22 at 11:06
  • It works for me to uninstall the old version from the system. – Sachin Jun 02 '22 at 11:14
61

Scenario: Removing NodeJS when Windows has no Program Entry for your Node installation

I ran into a problem where my version of NodeJS (0.10.26) could NOT be uninstalled nor removed, because Programs & Features in Windows 7 (aka Add/Remove Programs) had no record of my having installed NodeJS... so there was no option to remove it short of manually deleting registry keys and files.

Command to verify your NodeJS version: node --version

I attempted to install the newest recommended version of NodeJS, but it failed at the end of the installation process and rolled back. Multiple versions of NodeJS also failed, and the installer likewise rolled them back as well. I could not upgrade NodeJS from the command line as I did not have SUDO installed.

SOLUTION: After spending several hours troubleshooting the problem, including upgrading NPM, I decided to reinstall the EXACT version of NodeJS on my system, over the top of the existing installation.

That solution worked, and it reinstalled NodeJS without any errors. Better yet, it also added an official entry in Add/Remove Programs dialogue.

Now that Windows was aware of the forgotten NodeJS installation, I was able to uninstall my existing version of NodeJS completely. I then successfully installed the newest recommended release of NodeJS for the Windows platform (version 4.4.5 as of this writing) without a roll-back initiating.

It took me a while to reach sucess, so I am posting this in case it helps anyone else with a similar issue.

Michael M
  • 1,303
  • 1
  • 12
  • 12
  • 6
    In case someone wants to go with this answer, here's all Node versions available for download: https://nodejs.org/en/download/releases/ – Lucio Paiva Dec 17 '16 at 02:22
  • Worked form, I had to update from 0.12.0 -> 0.12.18 and then 0.12.18 -> 6.5 – Bruno Deprez Feb 02 '17 at 00:46
  • I am having node version 0.12.2 installed with VS 2015/2017 installation. I need to upgrade it to latest version, so I went forward with your solution. After installing that version via installer, I was able to remove Node.js from Control Panel. But when I checked node current version, it is still showing me the same version installed. Any ideas? Thanks. – Deepak Pathak May 16 '17 at 06:45
  • 2
    This solution has worked for me twice, on different machines. Its behavior suggests that the new NodeJS version you installed was not truly removed. You want a fresh command prompt or console window. Make sure that you have closed any command prompts or console windows you were using before uninstalling Node. Open a fresh command prompt and verify the version. Finally, I do not believe that NodeJS writes any Win Registry keys, although you could have a second installation of Node that is still referenced by the Windows Path, such as from an IDE or other developer application. – Michael M May 26 '17 at 20:00
  • You could also have a memory/file lock. If you haven't resolved your issue yet, simply perform a fresh boot of Windows without launching any unnecessary applications. Then try uninstalling NodeJS again. – Michael M May 26 '17 at 20:06
45

Whatever Node.js version you have installed, run its installer again. It asks you to remove Node.js like this:

Node.js Setup window with buttons for Change, Repair, Remove

Rory O'Kane
  • 29,210
  • 11
  • 96
  • 131
Deepa
  • 850
  • 1
  • 10
  • 11
  • 2
    I tried this. I had a node 9.x and a node 12.x. both managed by nvm. It uninstalled the 9.x but it left the 12.x orphaned. Rerunning the installer didn't recognize that I had a version of node on machine still. The solution was to run the installer again to reinstall it then uninstall it. There is no more node but "nvm list" still shows those 2 versions. – Mark Irvin Apr 07 '20 at 02:43
  • @Mark Irvin that is because this works for a specific version, and if you used an installer – David Lee May 28 '20 at 03:53
  • this is the correct answer – java-addict301 Jan 05 '22 at 18:31
  • not relevant in 2023 – max Jan 16 '23 at 21:03
16

I actually had a failure in the Microsoft uninstall. I had installed node-v8.2.1-x64 and needed to run version node-v6.11.1-x64.

The uninstalled was failing with the error:

Windows cannot access the specified device, path, or file

or similar.

I ended up going to the Downloads folder right-clicking the node-v8.2.1-x64 MSI and selecting uninstall.. this worked.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
user3049320
  • 191
  • 1
  • 5
  • Thank you! I no longer had the older version, however fetching the same version of the installer it's complaining about that's missing, and then following the same steps you suggested worked perfectly. – ManselD Mar 10 '21 at 01:08
5

In my case, the above alone didn't work. I had installed and uninstalled several versions of nodejs to fix this error: npm in windows Error: EISDIR, read at Error (native) that I kept getting on any npm command I tried to run, including getting the npm version with: npm -v.

So the npm directory was deleted in the nodejs folder and the latest npm version was copied over from the npm dist: and then everything started working.

James Drinkard
  • 15,342
  • 16
  • 114
  • 137
  • 3
    Wow, quite a chore to remove Node from Windows, isn't it? I don't think this is a common state, but it has obviously happened to a number of us... ;-) I'd expect that installation and removal is more streamlined and successful using Mac OS and Linux, since their underlying architecture is native for npm and node. – Michael M Feb 28 '17 at 17:20
3

I came here because the Remove button was not available from Add/Remove programs. It was saying "Node.js cannot be removed".

This worked:

  1. Got the .msi of my installed Node version. Ran it to repair the installation just in case.
  2. Opened the Administrator command prompt and ran msiexec /uninstall <node.msi>.
Mikhail Orlov
  • 2,789
  • 2
  • 28
  • 38
3

How to completely remove node.js from Windows


I also ran into this issue on Windows 10.

Solution

I uninstalled NVM for Windows 1.1.7. During the uninstallation, it said it would uninstall all versions of Node.js and npm. Both are now gone :-)

Super Jade
  • 5,609
  • 7
  • 39
  • 61
1

I had the same problem with yesterday and my solution is to

  1. Uninstall from the control panel, not from your cli
  2. Download and install the latest or desired version of node from its website.

If by mistake you tried uninstalling through cli (it will not remove completely most often), then you do not get the uninstall option in the control panel. In this case, install the same version of node and then follow step 1.

Hope it helps someone.

Super Jade
  • 5,609
  • 7
  • 39
  • 61
-1

The best thing to do is to remove Node.js from the control panel. Once deleted download the desired version of Node.js and install it and it works.

JJJ
  • 32,902
  • 20
  • 89
  • 102
  • 6
    as mentioned in the question, older nodejs uninstalled by the user and installed latest, and then he faced an issue, that is the reason he posted this question, you might not have faced the same issue, so this is not an answer to the question. – dkb Oct 05 '18 at 11:22