madskristensen / WebEssentials2015

A Visual Studio extension for web developers
Other
300 stars 92 forks source link

packjson.json not works for multiple projects in one solution #64

Closed Rendxx closed 9 years ago

Rendxx commented 9 years ago

I met a problem when I tried to setup npm in my second project in a solution. My projects are MVC4 websites built in vs2013. I updated visual studio to 2015, and tried to import grunt / bower with web essentials 2015.

Everything worked well until I tried to setup my second project in the same solution. The packages I wrote in package.json(in object devDependencies) are not downloaded. Is there any limitation for npm about multiple project in 1 solution? Or did I miss anything?

madskristensen commented 9 years ago

There are no limits on using npm in multiple projects in same solution. Can you check the output window to see if there is an error?

Rendxx commented 9 years ago

There is no error in output window. I just re-checked it and here is some thing interesting I found.

  1. Edited and saved package.json in project A. Node packages were downloaded just as expected.
  2. Edited and saved package.json in project B(same solution). Package was not downloaded.
  3. I reopened the whole solution. And edited package.json in project B first this time. The packages in project B were downloaded. But editing package.json in project A did not work.

I guess there may be some kind of binding when a package.json is modified. And the binding is for the whole solution not a single project.


And there is another issue. I fixed it but it is worth to mention. By default, gruntfile.js imported by web essentials asks for the package "grunt-bower-task". But the dependency of this package is not wrote in package.json.

That will cause a " fail to run ..." error because lacking of package "grunt-bower-task" and the report window does not show the right error information. This is not a big problem and easy to fix. But it is so confused to new grunt/bower user like me.

madskristensen commented 9 years ago

Thanks for clarifying. I'll fix the Web Essentials issue of the grunt-bower-task not being installed. The rest of the bug is actually for VS itself and not Web Essentials. I've passed this bug along to the VS Web Team. Thanks again

Rendxx commented 9 years ago

Thank you. I think re-opening visual studio to download packages can be an easy workaround for now :)