Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing angular/cli crashes with error 404

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.

like image 440
irudji Avatar asked Oct 27 '22 11:10

irudji


1 Answers

Try the Below :

Option 1

  1. Open Command prompt as admin
  2. npm uninstall -g @angular/cli
  3. npm cache clean
  4. npm config set strict-ssl false
  5. npm install -g @angular/cli

OR :

Option 2

  1. Open Command prompt as admin
  2. npm uninstall -g @angular/cli
  3. npm cache clean
  4. npm config set proxy="http://proxy.example.com:8080"
  5. npm config set https-proxy="http://proxy.example.com:8080"
  6. npm config set strict-ssl false
  7. npm install -g @angular/cli

If you get the error reason: write EPROTO try,

  1. npm config set proxy="http://proxy.example.com:8080"
  2. 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.

like image 79
BPDESILVA Avatar answered Nov 09 '22 11:11

BPDESILVA