Error when installing Chocolatey package from local source
Asked Answered
S

1

6

I'm attempting to upgrade the 1password Chocolatey package to point to the latest version. Here are the steps I took:

  1. I downloaded the package from http://chocolatey.org/packages/1password.

  2. I opened the package in NuGet Package Explorer.

  3. I changed the download location to the new URL.

  4. I incremented the version number in the package metadata.

After doing this, I attempted to run locally with the following command:

cinst 1password -source C:\Workspace\1password.4.0.1.503.nupkg

This results in the following error:

Unable to find package '1password'.

Command 'install' failed (sometimes this indicates a partial failure). Additiona l info/packages: 1password

Here's a link to the nupkg file: https://www.dropbox.com/s/b8y0wfrv6y1ayej/1password.4.0.1.503.nupkg?dl=0

What am I doing wrong?

Steelwork answered 26/9, 2014 at 2:53 Comment(2)
What version of Chocolatey are you using?Sinh
@GaryEwanPark The newest. I just installed it.Steelwork
S
9

What you are describing should work. I have just tried with Chocolatey 0.9.8.27, and it did indeed work. This is what I have done:

  1. Download your nupkg into my Downloads folder.
  2. Execute the following command (NOTE: cinst is the same as choco install)

    choco install 1password -source C:\Users\gep13\Downloads

  3. And Chocolatey successfully installed 1password version 4.0.1.503.

The only reason that I can think that your command wouldn't work is that the nupkg wouldn't exist in the C:\Workspace folder. Can you confirm that this is indeed where you have placed the nupkg package?

NOTE: The source argument needs to point to the folder that the *.nupkg reside in, NOT to the *.nupkg itself. It takes a directory as NuGet (the underlying mechanism that Chocolatey uses) can figure out what it the latest version of a package available in that directory. If you want to install a specific version of a *.nupkg from the source directory, you would then do something like:

choco install MyPackage -source c:\MyDirectory -version 1.2.3.4
Sinh answered 26/9, 2014 at 6:9 Comment(4)
A few more bits of info... I uninstalled the existing 1password that I installed from the Chocolatey Gallery to install my new version. Could that be the problem?Steelwork
Got it! The issue was because I pointed the source arg to the file itself, not the folder. I accepted your answer, but can you edit and point that out explicitly so future readers can see? Thanks!Steelwork
Ah, that would do it :-) Yip, I will edit the answer just now.Sinh
As an additional note, I've had issues trying to install from a local directory if I try and specify it AFTER package parameters, but it works fine if specified before them. cinst somepackage -y -s . -params 'myparam=something' works, but cinst somepackage -y -params 'myparam=something' -s . fails for me. Could just be a typo, but I started using a script with the stanza that worked and it was of the former layout.Yukyukaghir

© 2022 - 2024 — McMap. All rights reserved.