Can Chocolatey recognize manual nodejs installation?

Running the command node -v

gives the following meaning: v0.10.33

. I know nodejs is currently at version 0.12. However, at startup choco update nodejs

, the prompt says "Nothing to update". The same thing happens with npm after "choco update npm".

I have installed nodejs from a setup package to my site nodejs.org. After a while, I also installed chocolate and started using the tool to install packages every time.

Is it possible chocolate to recognize an existing nodejs installation and choose to update choco there?

I would also like to get an npm update from chocolate in the same way as.


I don't 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 updating Chocolatey to v0.9.9.4

> choco list --local-only
Chocolatey v0.9.9.4 [nl] 0 packages installed.

      

I have updated nodejs using npm.

> node -v
v0.12.2

      

However after reinstalling nodejs in v0.10.33

> choco install nodejs -version 0.10.33

      

I cannot use npm

Can't find file in 'npm.cmd' (C: \ ProgramData \ chocolatey \ lib \ npm \ tools \ npm.cmd). This usually indicates a missing or moved file.

I will leave this until I fix the problem.

+3


source to share


2 answers


Another option, assuming you already have nodes installed via MSI, should start:

choco install nodejs -version 0.12.2 -y -n

The -n option, as described 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 to the Chocolatey repository, but does not run the associated install script.

This is what I "think" of you.

NOTE. Not all packages have chocolateyinstall.ps1 files and instead rely on Chocolatey's default behavior, i.e. create shims for the contained exe, etc. The skippowershell flag won't be, at best my knowledge, stop doing this.

+3


source


Chocolatey is currently unable to detect and include already installed applications in its own library. Now, if you installed nodejs MSI manually and then used Chocolatey to install the same or newer version, everything could work. The MSI system, while mysterious, is pretty reliable and the newest MSIs will use the older ones.

Can you run the Chocolatey command to show us exactly which nodes you've 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 the update. I have trimmed the logs, but you can see it is updating.

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

PS> node -v
v0.12.2

      

And the app in the Programs and Features applet in Control Panel gets updated as well. So nodejs MSI is doing the right thing here.

enter image description here

I think we need to see some more literal command output from your system to make sure you have all the correct versions installed.

+1


source







All Articles