angular: Angular2 rc1, unabled to download packages via npm

Trying to upgrade to Angular2 rc1, but seems that npm is not able to download the packages:

{
  "name": "App",
  "version": "1.0.0",
  "license": "MIT",
  "dependencies": {
    "@angular/common": "2.0.0-rc.1",
    "@angular/compiler": "2.0.0-rc.1",
    "@angular/core": "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/http": "2.0.0-rc.1",

    "systemjs": "0.19.27",
    "es6-shim": "^0.35.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
     "gulp": "3.9.1",
     "gulp-rimraf": "0.2.0",
     "gulp-uglify": "1.5.3",
     "gulp-concat": "2.6.0",
     "gulp-cssmin": "0.1.7",
     "gulp-replace": "0.5.4"
   }
}

and the output:

npm http GET https://registry.npmjs.org/es6-shim
npm http GET https://registry.npmjs.org/reflect-metadata
npm http GET https://registry.npmjs.org/angular/common
npm http GET https://registry.npmjs.org/angular/compiler
npm http GET https://registry.npmjs.org/angular/core
npm http GET https://registry.npmjs.org/angular/platform-browser-dynamic
npm http GET https://registry.npmjs.org/rxjs
npm http GET https://registry.npmjs.org/angular/router
npm http GET https://registry.npmjs.org/angular/http
npm http GET https://registry.npmjs.org/systemjs
npm http GET https://registry.npmjs.org/zone.js
npm http GET https://registry.npmjs.org/angular/platform-browser
npm http 304 https://registry.npmjs.org/reflect-metadata
npm http 404 https://registry.npmjs.org/angular/common
npm ERR! 404 Not Found
npm ERR! 404 
npm ERR! 404 'angular/common' 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 'App'
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.1.7601
npm ERR! command "npm" "install"
npm ERR! cwd ...
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm ERR! code E404
npm http 404 https://registry.npmjs.org/angular/platform-browser-dynamic
npm http 404 https://registry.npmjs.org/angular/core
npm http 404 https://registry.npmjs.org/angular/compiler
npm http 304 https://registry.npmjs.org/systemjs
npm http 304 https://registry.npmjs.org/es6-shim
npm http 304 https://registry.npmjs.org/rxjs
npm http 404 https://registry.npmjs.org/angular/http
npm http 404 https://registry.npmjs.org/angular/platform-browser
npm http 404 https://registry.npmjs.org/angular/router
npm http 304 https://registry.npmjs.org/zone.js

All gulp packages are downloaded successfully which tells me my environment is functional. So it must be something with registration?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 44 (3 by maintainers)

Most upvoted comments

I have a global registry in my npm config which uses a private repo. And since it fails to download the packagename that starts with @ I had to do the following:

Create a .npmrc file inside you module with the following content:

always-auth=false
@angular:registry=http://registry.npmjs.org

i figured out the problem was a config in ~/.npmrc for a private npm registry. probably my old private registry could not handle the @

I got it working locally. The following did the trick for me. You may have to execute the commands with sudo in some cases. npm cache clean npm set registry http://registry.npmjs.org npm update -g

An error such as “@angular/compiler is not in the npm registry” suggests that Visual Studio 2015 is using an older version of npm. Update to the latest installed version of npm:

Tools | Options to open the Options dialog. In the tree on the left, select Projects and Solutions | External Web Tools. On the right, move the $(PATH) entry above the $(DevEnvDir) entries. This tells Visual Studio to use the external tools (such as npm) found in your path before using its own version of the external tools. Click OK to close the dialog. Restart Visual Studio for this change to take effect.

Upgrade your node/npm version. I’m current on node v5.10.1 and npm v3.8.6+

Have the same problem. @mehranTM thanks for the nvm tool, verry helpfull. @mcdurdin thanks too, my npm path is the one expexted. I’m not sure if it’s normal, but when we go to https://www.npmjs.com/package/angular2, we can see that “2.0.0-beta.17 is the latest of 68 releases” And npm install show the same in error :

npm ERR! No compatible version found: angular2@2.0.0-rc.1
npm ERR! Valid install targets:
npm ERR! 2.0.0-beta.17, 2.0.0-beta.16, 2.0.0-beta.15, 2.0.0-beta.14,...etc.

FYI I think the npm installation is a total mess - local registries and remote registries - multiple locations where node is installed - lots of version dependencies - surely its time this was cleaned up as node is now version 10 and npm is version 6. Probably not the correct place to voice this - but I see lots of people wasting lots of time on installation issues.

I was getting the 404 error and I noticed in visual studio there was a npm -v and node -v that showed old version numbers. I found out that visual studio had its own copies of npm and node in this directory for vs2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External

I deleted the node and npm directories in there plus the node and npm commands in the External directory, reloaded visual studio and waited about 3 minutes and got success via the following:

added 1103 packages from 1166 contributors in 159.464s [!] 19 vulnerabilities found [5895 packages audited] Severity: 10 Low | 4 Moderate | 5 High Run npm audit for more detail

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

Update NPM and node. That worked for me.

On Thu, Sep 29, 2016 at 7:53 PM, jbgarr notifications@github.com wrote:

@battistaar https://github.com/battistaar I am having the same issue regarding an old private npm registry not being able to handle the @ sign. Any ideas on how to deal with that (other than commenting out the .npmrc code then running npm install again after the rest of the packages are installed)? I’d prefer to fix the issue if possible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular/issues/8473#issuecomment-250624257, or mute the thread https://github.com/notifications/unsubscribe-auth/AAx0KB81VoZlDJDr1Al7qYCHlkcFbr6Eks5qvE-EgaJpZM4IXfea .


“May the source be with you.”

@Ferhatos At the very least you need to change your package name from angular2 to @angular

Try something like this

"@angular/core": "2.0.0-rc.1",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1"

and whatever other @angular modules you need. The angular2 package name stopped at beta.17.

If you use NVM, you can install different versions of node side-by-side and switch between them easily. I am using the Windows version https://github.com/coreybutler/nvm-windows

Anyone else on Windows and having persistent issues with this try: Get-Command npm | Select-Object -ExpandProperty Definition (basically which npm on windows)

I felt quite idiotic after spending a day not realizing my Path variable was using a higher priority super old Node/NPM from visual studio.

I had the same issue on windows and changing the private registry to public solved it. npm config set registry https://registry.npmjs.org/

The package name is fine, see https://www.npmjs.com/~angular, there’s something else going on and for some cases upgrading node/npm is enough, can’t say what’s the problem in your case 😕