Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Projects Visual Studio 2015 npm

I have one solution with 3 web projects, 2 of which I would like to use a package.json (names: 'Site' and 'SatelliteSite'). These are all ASP.NET 4 projects that I am retrofitting npm/gulp/bower into, which works fine for 1 project which is why I'm so confused by my issue.

When I save the package.json in either of the 2 projects, the Package Manager Log goes off and runs npm install. That's great, with one exception.

What it is actually running, despite picking up the changes in both package.json files is just the 'Site' package.json. Upon restarting Visual Studio, it's now picking up 'SatelliteSite' and running with that package.json, which is great as I now have my dependencies for gulp, but rubbish if I ever needed to update.

Unloading the SatelliteSite project doesn't work as when saving it within Site, it still loads the SatelliteSite package.json. It's almost like it "registers" the first package.json it sees (ie. SatelliteSite loads before Site so after restart that is loaded first) and ignores the others, whilst still tracking for changes.

I'm assuming this is a bug in Visual Studio - but perhaps I'm doing something wrong and wondering if anyone else has encountered also / has any workarounds?

EDIT: A bit more info, I renamed the package.json in SatelliteSite now to a different name, and saved Site's package.json. It throws this error, which shows VS is basically setting the working directory for npm based on the first package.json it comes across, regardless of project.

npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Development\source\Cedita.Site\Cedita.SatelliteSite
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm ERR! path C:\Development\source\Cedita.Site\Cedita.SatelliteSite\package.json
npm ERR! code ENOPACKAGEJSON
like image 424
Rudi Visser Avatar asked Jul 17 '15 16:07

Rudi Visser


1 Answers

I'm pleased to confirm that this issue is resolved in Visual Studio 2015 RTM.

====Executing command 'npm install'====

npm WARN package.json [email protected] No description

====npm command completed with exit code 0====


====Executing command 'npm install'====

npm WARN package.json [email protected] No description

====npm command completed with exit code 0====
like image 172
Rudi Visser Avatar answered Sep 19 '22 14:09

Rudi Visser