Windows – Chocolatey Uninstall NodeJS Windows 8

chocolateynode.jsuninstallwindows 8

Ok, so I installed NodeJS by using cinst nodejs Which installs NodeJS into the Chocolatey bin directory with a dependency on NPM.

I then realised that I wanted to install NodeJS.Install instead which installs NodeJS to my ProgramFiles Directory using the main NodeJS install with a dependency on NPM.

My Question:
Now that both are installed. Which will be used when I run a node or NPM command and how do I uninstall NodeJS from the Chocolatey bin if cuninst nodejs does not work?

Best Answer

The installed version of nodejs comes with npm installed so you don't need that. However removing the nodejs package is not enough as it is a meta package that points to either the *.install or *.commandline packages.

Please do the following:

  1. Ensure you are on the more recent version of choco (0.9.9.x series)
  2. choco uninstall npm -dvyaf
  3. choco uninstall nodejs.commandline -dvyaf

This will remove all versions of npm and remove the bin files (shim redirects that are on the path. Then it will remove the portable version of nodejs (nodejs.commandline) and all versions. These are force removes to clean up the directories completely.

If you have already done some of this, just head into the %ChocolateyInstall%\lib directory and remove the folders that start with npm and nodejs.commandline.