Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm angularjs 2 - "angular/compiler" dependency not found

Trying to work with the latest RC of angualr 2 (2.0.0-rc.1) and NPM is unable to download the following dependency "@angular/compiler": "2.0.0-rc.1", with NPM showing a 404 error.

npm http 404 https://registry.npmjs.org/angular/compiler
npm ERR! 404 Not Found

Looks similar to the following question but I'm using the new @scope as specified in the tutorial. My full package.json is given below.

{
  "dependencies": {
    "@angular/common": "2.0.0-rc.1",
    "@angular/compiler": "2.0.0-rc.1",
    "@angular/core": "2.0.0-rc.1",
    "@angular/http": "2.0.0-rc.1",
    "@angular/platform-browser": "2.0.0-rc.1",
    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
    "@angular/router": "2.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.1",
    "@angular/upgrade": "2.0.0-rc.1",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "0.6.12",
    "angular2-in-memory-web-api": "0.0.7",
    "bootstrap": "^3.3.6"
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.2.0"
  }
}
like image 355
CountZero Avatar asked May 04 '16 12:05

CountZero


2 Answers

If you're using visual studio's inbuilt npm, you can still upgrade it, see http://jameschambers.com/2015/09/upgrading-npm-in-visual-studio-2015/

I used the approach in that article of updating the external tools paths to reference a newly installed npm.

This seems to address the issue in the OP, and worked for me. So as far as I can tell, the solution in the linked article works.

Just to add, it may be necessary to clean the node_modules folder and then resave package.json - I did that and got a successful npm install from within visual studio.

like image 79
Chris H Avatar answered Oct 14 '22 10:10

Chris H


The solution for this issue can be upgrading the version of Node and NPM as described here (problem exists with NPM/Node versions - anything above node v5.10.1 and npm v3.8.6+ seem to be fine).

angular2 npm http 404 with all rc1 packages

https://github.com/angular/angular/issues/8473

However my problem appears to stem from using the Visual Studio integration with NPM. By dropping down to the command line and running 'npm install' manually my problem went away. I'm guessing is has something to do with the new module '@' syntax.

Failing that it is worth checking your proxy settings and configuring NPM to work with them.

like image 41
CountZero Avatar answered Oct 14 '22 10:10

CountZero