6

I'm currently using Visual Studio 2015 to work on a project which is using NPM/Bower to manage the Javascript package dependencies. One of the packages we are using and have installed through Bower is knockout-3.4.0.

If I go to wwwroot/lib/knockout and delete the folder, VS Solution Explorer notices that a package is no longer installed under the dependencies node - if I then run Restore Packages from this menu it tries to pull knockout back into the lib directory.

However, each time it does this it fails to download the /dist directory and the file within it. If I do exactly the same thing on my colleagues machine behind me (very similar build environments) VS 2015 will restore the package including the /dist folder.

What am I doing wrong? I tried clearing out the bower cache and doing a re-install but got the same problems. Without the contents of /dist the application doesn't work.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\Bower.cmd" install --force-latest
bower knockout#>=2.2        not-cached https://github.com/SteveSanderson/knockout.git#>=2.2
bower knockout#>=2.2           resolve https://github.com/SteveSanderson/knockout.git#>=2.2
bower knockout#>=2.2          checkout v3.4.0
bower knockout#>=2.2          resolved https://github.com/SteveSanderson/knockout.git#3.4.0
bower knockout#>=2.2           install knockout#3.4.0
Gareth
  • 439
  • 5
  • 12

2 Answers2

4

I experienced this problem and it was due to stale packages in the local bower cache.

I ran this command to clean the cache:

bower cache clean knockout

Then I was able to reinstall the knockout package without any trouble.

Thanks,

Brian Gehrs

Brian Gehrs
  • 41
  • 1
  • 4
  • 1
    +1, this solved it for me as well. Important note: after clearing the cache, I had to uninstall Knockout package (bower uninstall knockout), then install it again before the new package showed up. – Judah Gabriel Himango Oct 20 '16 at 17:49
0

This problem appears to have been caused by pointing our application to look at knockoutjs instead of knockout in Bower scripts

Gareth
  • 439
  • 5
  • 12