Search code examples
angularjsnpmangularjs-routingangularjs-components

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 https://docs.angularjs.org/guide/component-router, 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!     <https://github.com/npm/npm/issues>

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 [email protected] 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.


Solution

  • 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 https://registry.npmjs.org/
    npm install @angular/router --save