Error when installing Chocolatey package from local source

Mike Cole picture Mike Cole · Sep 26, 2014 · Viewed 7.9k times · Source

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?

Answer

Gary Ewan Park picture Gary Ewan Park · Sep 26, 2014

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