7

I want to upgrade from angular 2 Beta 15 to angular 2 RC1.

I am using Visual Studio 2015.

In my npm package.json inside Visual Studio I do:

 "dependencies": {
    "@angular/core": "Unavailable",
}

but I get unavailable.

Then I did some updates:

I updated my nodejs to v6.1.0.
I updated my npm to v3.8.9.

It still shows unavailable in Visual Studio 2015.

What can I still try to make it work?

UPDATE

After doing what @David Pine suggested I got this error:

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


npm WARN package.json ASP.NET@0.0.0 No description
npm WARN package.json ASP.NET@0.0.0 No repository field.
npm WARN package.json ASP.NET@0.0.0 No README data
npm http GET https://registry.npmjs.org/angular/core
npm http 404 https://registry.npmjs.org/angular/core
npm ERR! 404 Not Found
npm ERR! 404 
npm ERR! 404 'angular/core' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'ASP.NET'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Windows_NT 6.2.9200
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:\TGB.2016\TGB.Web
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm ERR! code E404

====npm command completed with exit code 1====

UPDATE 2

I also added the correct path to nodejs in my Visual Studio options see:

http://ryanhayes.net/synchronize-node-js-install-version-with-visual-studio-2015/

Pascal
  • 12,265
  • 25
  • 103
  • 195

2 Answers2

4

Ensure that Node.js is at the top of the external web tools paths in Visual Studio, detailed here.

I have found that Visual Studio 2015 can be unreliable in terms of integrating with npm. Instead of relying on VS to update it for you, open up the package.json and manually enter the version you're looking for.

Instead of:

"dependencies": {
    "@angular/core": "Unavailable",
}

Enter:

"dependencies": {
    "@angular/core": "2.0.0-rc.1",
}
David Pine
  • 23,787
  • 10
  • 79
  • 107
  • Oh... I was wrong... I did not move the nodejs path to the top in my Visual studio options, now it works! at least angular 2 RC1 is installed! Argh... still getting some python errors from the npm execution. – Pascal May 12 '16 at 18:43
  • No because the problem was the missing nodejs entry in visual studio options just like the link I posted. When I moved the nodejs path entry at the top for priority 1 then it worked! I just upvoted you for the general help and time lost ;-) – Pascal May 12 '16 at 19:21
0

Open command prompt (cmd) in your project folder and type 'npm install' or check this thread

The solution in that thread worked to me.

project.json is still not showing @angular module but once you save the project.json it will install all the dependencies by npm.

Follow this post:

Community
  • 1
  • 1
Ahamed Ishak
  • 972
  • 11
  • 16