Jonathan Mellman Jonathan Mellman - 1 year ago 220
AngularJS Question

Can't install Angular 1.5 component router

I'm trying to install the Angular 1.5 component router for use in a new project, but having a lot of difficulty. As per, the following should work:

npm install @angular/router --save

Here's what I see:

$ npm install @angular/router --save
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/JonathanM/.nvm/versions/node/v4.4.2/bin/node" "/Users/JonathanM/.nvm/versions/node/v4.4.2/bin/npm" "install" "@angular/router" "--save"
npm ERR! node v4.4.2
npm ERR! npm v3.8.6
npm ERR! code E400

npm ERR! 400 Bad Request
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/JonathanM/Workspace/my-angular-app/npm-debug.log

With node v4.4.2 and npm v3.8.6.

I feel like I'm on the wrong version of npm or something, because I also can't install angular with the syntax they mention in the docs (
npm install@1.5.x angular --save
). When I try, I get a generic
Usage: npm <command>
error, like it doesn't even recognize the command.

Am I doing something wrong? Did the package(s) get pulled/moved? Any help would be appreciated.

Answer Source

As @PeteBD suspected in his comment, I was pointing to a private npm repo. I was able to successfully install the router with:

npm config set registry
npm install @angular/router --save
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download