Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2.0.0 rc0 in Visual Studio 2015 - npm not working

I am using the new Angular 2.0.0 rc0 release inside Visual Studio 2015 Update 2.

Previously (Angular 2 beta 17) I could create my "package.json" file, with the correct dependencies, then right-click it and select "restore packages", and it would create a "node_modules" folder, and install the correct files.

Now, I have a new "package.json" file, with the correct angular 2.0.0 rc0 dependencies inside, and when I do a "restore packages" on that, it does not create a "node_modules" folder, and instead just outputs a whole bunch of errors (mainly 404 and 304, that sort of thing).

I can do the "Angular 2 Quickstart" with my installed version of npm without a problem. I'm thinking it may be a problem with Visual Studio's internal version of npm? Maybe it's an old version or something?

If I do an "npm install" (via command line) on my project directory, it correctly creates the "node_modules" folder... but I want VS2015 to be able to do this!

Anyone have ideas?

like image 551
NightCabbage Avatar asked Dec 07 '25 07:12

NightCabbage


1 Answers

From VS, go to Tools --> Projects and Solutions --> External Web Tools.

Click the 'Add' button on the top right, and add the location of your nodejs install (something like C:\Program Files\nodejs), and move this to the top of the list.

This will cause VS to use your installed nodejs version, and fix this error.

like image 179
James Avatar answered Dec 09 '25 03:12

James



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!