1

我正在尝试安装 Angular 1.5 组件路由器以用于新项目,但遇到了很多困难。根据https://docs.angularjs.org/guide/component-router,以下应该有效:

npm install @angular/router --save

这是我看到的:

$ 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

使用节点 v4.4.2 和 npm v3.8.6。

我觉得我使用了错误版本的 npm 或其他东西,因为我也无法使用他们在文档(npm install@1.5.x angular --save)中提到的语法安装 angular。当我尝试时,我得到一个通用Usage: npm <command>错误,就像它甚至无法识别命令一样。

难道我做错了什么?包裹是否被拉/移动?任何帮助,将不胜感激。

4

1 回答 1

1

正如@PeteBD 在他的评论中所怀疑的那样,我指的是一个私人 npm 存储库。我能够成功安装路由器:

npm config set registry https://registry.npmjs.org/
npm install @angular/router --save
于 2016-04-17T19:16:03.263 回答