2016-04-17 23 views
1

Angular 1.5コンポーネントルータを新規プロジェクトに使用するためにインストールしようとしていますが、難しかったです。 https://docs.angularjs.org/guide/component-routerあたりとして、次のように動作するはずです:Angular 1.5コンポーネントルータをインストールできない

npm install @angular/router --save 

は、ここで私が見たものです:

ノードv4.4.2およびNPMのv3.8.6で
$ 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 

私はnpmや何かの間違ったバージョンを使っているように感じます。なぜなら、それらがドキュメント(npm [email protected] angular --save)に書かれている構文で角度を付けることができないからです。試してみると、コマンドを認識しないような一般的なUsage: npm <command>エラーが表示されます。

何か間違っていますか?パッケージは引っ張られた/移動されましたか?どんな助けもありがとう。

+0

私は問題があなたがメインパブリックnpmレジストリを使用していないということですか? –

+0

うわー、それはまったく元気でした! 'npm設定レジストリhttps:// registry.npmjs.org /'と 'npm install @ angular/router --save'を再試行しました! npmはまだ 'npm [email protected] angular --save'構文を認識しませんが、角度がインストールされているので大したことではありません。 –

答えて

1

@PeteBDが彼のコメントで疑われたように、私はプライベートnpmリポジトリを指していました。私は正常にルータをインストールすることができました:

npm config set registry https://registry.npmjs.org/ 
npm install @angular/router --save 
+0

私はあなたが おそらく何か '' ' のようなNPMログイン--registry = httpsを...グローバルであなたのレジストリを設定することなく、公開レジストリと' @ angular'スコープを関連付けることができると信じて://registry.npmjs.org --scope = @ angular '' ' https://docs.npmjs.com/misc/scope#associating-a-scope-with-a-registryを参照してください。 –

関連する問題