I have a little problem when installing angular/cli on my computer. I´ve installed latest stable version of Node.js (currently v. 10.16.0 with npm 6.9.0). Installation finished successfully without any problem.
After installation I've tried to install angular/cli in command prompt and I get this error.
npm ERR! code E400
npm ERR! 400 Bad Request - GET https://registry.npmjs.org/@angular%2fcli
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\h053z9rc\AppData\Roaming\npm-cache\_logs\2019-07-09T05_03_06_062Z-debug.log
and in the log file are these informations
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 '-g',
1 verbose cli '@angular/cli' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 336717238679caae
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 400 https://registry.npmjs.org/@angular%2fcli 141ms
8 silly fetchPackageMetaData error for @angular/cli@latest 400 Bad Request - GET https://registry.npmjs.org/@angular%2fcli
9 timing stage:rollbackFailedOptional Completed in 0ms
10 timing stage:runTopLevelLifecycles Completed in 177ms
11 verbose stack Error: 400 Bad Request - GET https://registry.npmjs.org/@angular%2fcli
11 verbose stack at res.buffer.catch.then.body (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)
11 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
12 verbose statusCode 400
13 verbose pkgid @angular/cli@latest
14 verbose cwd C:\Windows\System32
15 verbose Windows_NT 10.0.15063
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
17 verbose node v10.16.0
18 verbose npm v6.9.0
19 error code E400
20 error 400 Bad Request - GET https://registry.npmjs.org/@angular%2fcli
21 verbose exit [ 1, true ]
I've tried to reinstall node.js but it didn't help.
Try the Below :
Option 1
npm uninstall -g @angular/cli
npm cache clean
npm config set strict-ssl false
npm install -g @angular/cli
OR :
Option 2
npm uninstall -g @angular/cli
npm cache clean
npm config set proxy="http://proxy.example.com:8080"
npm config set https-proxy="http://proxy.example.com:8080"
npm config set strict-ssl false
npm install -g @angular/cli
If you get the error reason: write EPROTO
try,
npm config set proxy="http://proxy.example.com:8080"
npm config set https-proxy="http://proxy.example.com:8080"
Follow Option 2
If all the above fails try to install the latest stable version of node & npm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With