1

Firstly I installed the latest version of angular cli. Then when I tried to downgrade to 7.3.3 there was an error: 400 Bad Request - GET https://github.com/. Also I can not install anything with npm install like node-sass etc. So I unistalled nodejs and tried to install again angular cli, but the same error appeared. Maybe I have changed any configuration.

CMD

C:\Windows\system32>node -v
v12.17.0

C:\Windows\system32>npm install -g @angular/cli
npm ERR! code E400
npm ERR! 400 Bad Request - GET https://github.com/

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\XXXX\AppData\Roaming\npm-cache\_logs\2020-06-01T10_49_37_560Z-debug.log

Logs

0 info it worked if it ends with ok
1 verbose cli [
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'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.17.0
4 verbose npm-session bc2383db262e35f5
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 400 https://github.com/ 506ms
8 silly fetchPackageMetaData error for @angular/cli@latest 400 Bad Request - GET https://github.com/
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 543ms
11 verbose stack Error: 400 Bad Request - GET https://github.com/
11 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15
11 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
12 verbose statusCode 400
13 verbose pkgid @angular/cli@latest
14 verbose cwd C:\Windows\system32
15 verbose Windows_NT 10.0.17763
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 v12.17.0
18 verbose npm  v6.14.4
19 error code E400
20 error 400 Bad Request - GET https://github.com/
21 verbose exit [ 1, true ]
Boris
  • 35
  • 1
  • 2
  • 7

2 Answers2

2

1.>Go to your this location

C:\Users\{your user name or ID}

2.> open .npmrc & Remove all content from .npmrc file.

3.>reopen your new command prompt

4.>again run the code , will work.

SPothodi
  • 31
  • 2
0

you must enable developer mode first in windows 10

  • setting
  • update & security
  • for developers
  • and enable developer mode

image

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51
Dzaka
  • 1