How to properly kpm cache clean?

339 views Asked by At

I'm trying to use ASP.NET 5 and their new command line tools (kpm, kvm, etc) on my Mac (OSX 10.10.1) but I'm having problems with kpm install. The install generally works fine, except when a new version of a package was just published, kpm says it is unable to locate the package, e.g.:

~/Projects/myproj: kpm install My.Custom.Pkg 1.0.4
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='My.Custom.Pkg'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='My.Custom.Pkg'
  CACHE http://tools.production.com/nuget/FindPackagesById()?Id='My.Custom.Pkg'
My.Custom.Pkg.1.0.4 was added to project.json.
Restoring packages for /Users/montgomeryc/Projects/myproj/project.json
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='My.Custom.Pkg'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='My.Custom.Pkg'
  CACHE http://tools.production.com/nuget/FindPackagesById()?Id='My.Custom.Pkg'
Resolving complete, 4286ms elapsed
Unable to locate My.Custom.Pkg >= 1.0.4
Restore complete, 4294ms elapsed

If I wait about 20 minutes and kpm install My.Custom.Pkg 1.0.4 again, it will find the new package version. This seems to be a problem with the kpm cache because I can open up Visual Studio on my Windows machine and find the newly published package instantly.

My question is: is there a way to forcefully clear the local kpm cache? And not the ~/.kpm/packages directory either... that doesn't seem to help this use case. There seems to be another internal http cache when it's making the GET request to the various NuGet feeds.

1

There are 1 answers

1
Victor Hurdugaci On BEST ANSWER

Use the --no-cache argument for kpm install:

kpm install --no-cache My.Custom.Pkg 1.0.4