511

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.

2
  • 3
    This sounds bad, but did you restart afterwards? Commented Dec 20, 2013 at 20:19
  • 1
    Find the uninstaller (e.g. WIN-key, Uninstall NodeJS). Worked for me. Commented Nov 9, 2020 at 15:09

12 Answers 12

1243

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.

Sign up to request clarification or add additional context in comments.

31 Comments

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.
Ahh, it turns out I had Meteor installed which came packaged with it's own node.exe. Thanks for your help!
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 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.
What about C:\Users\{User}\.node-gyp directory?
You know an answer is good when Microsoft links to it in their documentation...
|
62

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.

6 Comments

In case someone wants to go with this answer, here's all Node versions available for download: nodejs.org/en/download/releases
Worked form, I had to update from 0.12.0 -> 0.12.18 and then 0.12.18 -> 6.5
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.
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.
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.
|
56

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

2 Comments

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 that is because this works for a specific version, and if you used an installer
17

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.

Comments

4

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.

Comments

4

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 :-)

Comments

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>.

Comments

3

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.

Comments

0

Just deleting nodejs from program files does not uninstall it completely. Go to "Add or Remove Programs" in Windows settings. Uninstall node from there and then install another version.

1 Comment

This looks similar to Ibnou's answer from 2018. Note DKB's comment.
0

Same things happen with me, I found the solution one of the video.

Solution: Download microsoft provided problem troubleshooter in your system, it's work for me https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d

or type in google: "download install and uninstall troubleshooter program by microsoft" after that open the first link,

After that install in your system, and run it, will show all the program which are installed in your system, select the corrupt one and uninstall from there, your issue will resolve.

Comments

0

I had the same errors. After having followed the steps in the top answer exactly - my problem persisted. It was only when I switched from Powershell to bash and reinstalled Node.js (and once again followed the steps in the top answer) did everything finally work. Most node.js/npm tutorials use bash anyways but it was something I overlooked since I thought Powershell and bash (and really any terminal) were interchangeable.

TL:DR Top answer works well, try bash if Powershell doesn't work. Hope this helps.

Comments

-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.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.