Reputation: 1587
Running command node -v
gives the following value: v0.10.33
. I know that Node.js currently is at version 0.12. Nevertheless, when running a choco update nodejs
, the prompt says "Nothing to update". The same occurs with npm after a "choco update npm".
I have installed Node.js from the install package on their website nodejs.org. A time after that I have also installed Chocolatey and have come to use the tool every now and then for package installations.
Is it possible to have Chocolatey recognize the existing Node.js installation and pick a choco update from there?
I would like to also be able to pick up the npm update from Chocolatey the same way as well.
I do not have the latest Chocolatey.
> choco list --local-only nodejs
Opción desconocida: '--local-only'
nodejs.commandline 0.12.2
npm 1.4.9.20150213
EthanBrown.DevTools.Web 0.3.1
ghost 0.5.5.1
io.js 1.7.1
livestreamer-twitch-gui 0.7.1
nodejs 0.12.2
nodejs.install 0.12.2
node-webkit-0.9.2 0.9.2
node-webkit 0.6.2
Brackets.Theseus 0.2.8
Yeoman 1.1.2
After upgrading Chocolatey to v0.9.9.4
> choco list --local-only
Chocolatey v0.9.9.4 [nl] 0 packages installed.
I updated Node.js using npm.
> node -v
v0.12.2
However, after reinstalling Node.js at version 0.10.33,
> choco install nodejs -version 0.10.33
I cannot use npm
:
Cannot find file at 'npm.cmd' (C:\ProgramData\chocolatey\lib\npm\tools\npm.cmd). This usually indicates a missing or moved file.
I'll leave it for now until I troubleshoot.
Upvotes: 4
Views: 3822
Reputation: 18981
Another option, assuming that you already have Node.js installed via the MSI would be to run:
choco install nodejs -version 0.12.2 -y -n
The -n parameter, as documented here:
https://github.com/chocolatey/choco/wiki/CommandsInstall#options-and-switches
Skips the PowerShell script associated with the Chocolatey package. This essentially adds the package version into the Chocolatey repository, but it doesn't run the associated installation script.
This is what I "think" you are after.
NOTE: Not all packages have chocolateyinstall.ps1 files, and instead rely on the default installation behaviour of Chocolatey, i.e. creating shims for contained EXE files, etc. The skippowershell flag will not, to the best of my knowledge, stop this from happening.
Upvotes: 5
Reputation: 22394
Chocolatey cannot currently detect and incorporate already installed applications into its own library. Now, if you installed the Node.js MSI manually and then used Chocolatey to install the same or newer version, things might just work. The MSI system, while arcane, is pretty robust and most newer MSIs will subsume older ones.
Can you run the Chocolatey command to show us exactly which Node.js you have installed?
PS> choco list --local-only nodejs
Chocolatey v0.9.9.2
nodejs 0.10.33
nodejs.install 0.10.33
2 packages installed.
I have the same version installed. I just ran an update. I snipped the logs, but you can see that it updates.
PS> choco upgrade nodejs
Chocolatey v0.9.9.2
nodejs.install v0.12.2
nodejs v0.12.2
Chocolatey upgraded 2/2 package(s). 0 package(s) failed.
And Node.js is up-to-date.
PS> node -v
v0.12.2
And the application in the Programs and Features applet of the Control Panel is also updated. So, the Node.js MSI does the right thing here.
I think we need to see some more literal command output from your system to be sure you have all the right versions installed.
Upvotes: 1