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.
How to remove Node.js from Windows:
Take a deep breath.
Run
npm cache clean --force
Uninstall from Programs & Features with the uninstaller.
Reboot (or you probably can get away with killing all node-related processes from Task Manager).
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-*
Check your
%PATH%
environment variable to ensure no references toNodejs
ornpm
exist.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.Reboot, for good measure.
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
. –
Furthest echo PATH
in your command prompt? what's that output? (redact as necessary) –
Manifestation node.exe
(be default it lives in the %programfiles%\nodejs
dir, but maybe it's ended up elsewhere? –
Manifestation C:\Users\{User}\AppData\Local\VirtualStore
? –
Manifestation %AppData%\npm-cache
directory which was ~100 MB. –
Singlehearted rm -r /c/Users/<me>/AppData/Roaming/npm
because of a too long file path –
Haphazard %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 https://mcmap.net/q/35729/-npm-hangs-on-any-command. @brandonscript, maybe add this to your answer as it is still a very popular google search result. –
Peisch C:\Users\{User}\.node-gyp
directory? –
Wellintentioned 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. –
Godoy C:\Users\{User}\.config
C:\Users\{User}\.node_repl_history
–
Errolerroll C:\Users\{User}\.config\configstore\update-notifier-npm.json
. In Win 10. –
Vein wmic product where "description='Node.js' " uninstall
–
Radius where node
helped me. The node was from other program. –
Lorenlorena C:\Users\{User}\AppData\Roaming\npm-cache
on my system –
Sisterly 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.
Whatever Node.js version you have installed, run its installer again. It asks you to remove Node.js like this:
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.
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.
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 :-)
I came here because the Remove button was not available from Add/Remove programs. It was saying "Node.js cannot be removed".
This worked:
- Got the .msi of my installed Node version. Ran it to repair the installation just in case.
- Opened the Administrator command prompt and ran
msiexec /uninstall <node.msi>
.
I had the same problem with yesterday and my solution is to
- Uninstall from the control panel, not from your cli
- 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.
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.
© 2022 - 2024 — McMap. All rights reserved.