The node instalation error
choco install nodejs -y --force
choco install nodejs -y --force
Chocolatey v0.10.8
Installing the following packages:
nodejs
By installing you accept licenses for the packages.
nodejs v9.9.0 already installed. Forcing reinstall of version '9.9.0'.
Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading nodejs 9.9.0... 100%
nodejs.install v9.9.0 (forced) [Approved]
nodejs.install package files install completed. Performing other installation steps.
Installing 64 bit version
Installing nodejs.install...
ERROR: Running ["C:\WINDOWS\System32\msiexec.exe" /i "C:\ProgramData\chocolatey\lib\nodejs.install\tools\node-v9.9.0-x64.msi" /quiet ] was not successful. Exit code was '1603'. See log for possible error messages.
The install of nodejs.install was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\nodejs.install\tools\chocolateyInstall.ps1'.
See log for details.
nodejs v9.9.0 (forced) [Approved]
nodejs package files install completed. Performing other installation steps.
The install of nodejs was successful.
Software install location not explicitly set, could be in package or
default install location if installer.
Chocolatey installed 1/2 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
Hi @lincolnbrito - 1603 is a generic error for an MSI install that can indicate lots of things, like a need for a pending reboot. I would suggest adding this to your install --install-args="'/l*v c:\nodeinstall.log'" and then looking through the MSI log to find the actual error on your system - try searching for "Return Value 3" and then look just above that for some notes on errors.
Other notes for future reference:
--force, it is an antipattern. If you want to upgrade a package, you use choco upgrade. If it is not installed, you can use choco install, just drop the force part of the argument.-dv, which is also captured in the log file. For reference, it looks something like this: https://gist.github.com/choco-bot/41b96fad672548e306f4f3330ff2a710#file-install-txtI had this same problem, and I got to fix it.
My problem is that I had installed another Chocolatey version before, and it was causing this problem.
If you have another Chocolatey version before installed, please ununinstall this, and the install the Chocolatey version that you want.
In my case, i was downgrading my nodejs to lts version.
choco uninstall nodejs is not enough to uninstall the nodejs, so I uninstalled it manually and now it works when I use choco install nodejs-lts
@ccharliemagne nodejs is just a meta-package without any code for installing/uninstalling. when uninstalling that package you also need to uninstall the nodejs.install package as well.
@ccharliemagne
nodejsis just a meta-package without any code for installing/uninstalling. when uninstalling that package you also need to uninstall thenodejs.installpackage as well.
Thanks for more info, it was a stupid mistake by me. I am new to chocolatey and assumed that it will do everything for me.
just to note, you can also use choco uninstall nodejs -x to remove any dependencies not referenced by any other package (be careful with this though, as it can potentially remove chocolatey as well in rare cases).