我无法安装@ angular / CLI软件包

时间:2018-07-29 03:46:51

标签: node.js angular npm angular-cli

npm错误!找不到404:@ angular / CLI @ latest

**

log:

**

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '@angular/CLI',
1 verbose cli   '-g' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose npm-session 55687b55be7d98d3
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 404 https://registry.npmjs.org/@angular%2fCLI 2180ms
8 silly fetchPackageMetaData error for @angular/CLI@latest 404 Not Found: @angular/CLI@latest
9 verbose stack Error: 404 Not Found: @angular/CLI@latest
9 verbose stack     at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
9 verbose stack     at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
9 verbose stack     at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
9 verbose stack     at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
9 verbose stack     at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
9 verbose stack     at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
9 verbose stack     at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
9 verbose stack     at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
9 verbose stack     at Immediate.Async.drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
9 verbose stack     at runCallback (timers.js:810:20)
9 verbose stack     at tryOnImmediate (timers.js:768:5)
9 verbose stack     at processImmediate [as _immediateCallback] (timers.js:745:5)
10 verbose cwd C:\Users\PURUSHOTHAM
11 verbose Windows_NT 10.0.17134
12 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@angular/CLI" "-g"
13 verbose node v8.11.3
14 verbose npm  v5.6.0
15 error code E404
16 error 404 Not Found: @angular/CLI@latest
17 verbose exit [ 1, true ]

2 个答案:

答案 0 :(得分:2)

npm install -g @angular/cli应该这样做。复制并粘贴到您的终端中。

编辑: 在Windows上,您可能想通过右键单击> Run as Administrator来以管理员身份启动终端。

在Mac / Linux上,请在前面添加sudo

答案 1 :(得分:0)

解决方案:

  • 转到安装它的Node.js文件夹(在我的情况下,它安装在路径c1'中)。
  • 现在在同一路径上打开cmd并输入c2'
  • 然后C:\Program Files\nodejs

应该可以。学习愉快!