0

How to solve the issue please help. (is that about very slow internet connection if that was the case than what's the min requirement?) C:\Windows\system32> node -v v12.16.2 C:\Windows\system32> npm -v 6.14.4 C:\Windows\system32> npm install -g @angular/cli npm ERR! Unexpected end of JSON input while parsing near '...r\n"},"deprecated":"`'

C:\Windows\system32> node -v
v12.16.2
C:\Windows\system32> npm -v
6.14.4
C:\Windows\system32> npm install -g @angular/cli
npm ERR! Unexpected end of JSON input while parsing near '...r\n"},"deprecated":"`'
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shafin\AppData\Roaming\npm-cache\_logs\2020-04-23T03_28_52_255Z-debug.log
PS C:\Windows\system32> npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
PS C:\Windows\system32> npm install -g @angular/cli
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@angular%2fcli (over 
 30000ms)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shafin\AppData\Roaming\npm-cache\_logs\2020-04-23T03_30_39_498Z-debug.log


log file details are bellow:
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.16.2
4 verbose npm-session aaee446bfd2a465d
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/@angular%2fcli 40063ms
8 http fetch GET 200 https://registry.npmjs.org/@angular/cli/-/cli-9.1.3.tgz 5183ms
9 silly pacote tag manifest for @angular/cli@latest fetched in 45301ms
10 timing stage:loadCurrentTree Completed in 45326ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
16 silly install loadAllDepsIntoIdealTree
17 silly resolveWithNewModule @angular/cli@9.1.3 checking installable status
18 http fetch GET 200 https://registry.npmjs.org/inquirer 9945ms
.....
89 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 
    Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
90 verbose node v12.16.2
91 verbose npm  v6.14.4
92 error Response timeout while trying to fetch (https://registry.npmjs.org/ansi-colors) (over `enter 
 code here`30000ms)
93 verbose exit [ 1, true ]

1 Answers1

0

İf its abaut the timing problem you should find a speed solutions for npm install. So you can try these faster command than npm install :

pnpm install 

or

npm install --no-audit

or

npm install --prefer-offline --no-audit  
Rahul Purohit
  • 540
  • 4
  • 16
  • hi dev,PS C:\Windows\system32> npm install -g @angular/cli --no-audit 15% faster npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name "15%": Tags may not have any characters that encodeURIComponent encodes. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\shafin\AppData\Roaming\npm-cache\_logs\2020-04-23T05_20_15_220Z-debug.log – Shahidur Rahman Apr 23 '20 at 05:23
  • hi dev, still have the problems. and cli is not being installed – Shahidur Rahman Apr 23 '20 at 05:31
  • please copy the commanf before `%` . faster thing is not part of command – Rahul Purohit Apr 23 '20 at 05:49
  • dear dev i have tried all of your commands(with/without options), but all results errors. PS C:\Windows\system32> npm install -g @angular/cli --prefer-offline --no-audit npm ERR! Unexpected end of JSON input while parsing near '...nwsFcBAEBCAAQBQJbu5kw' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\shafin\AppData\Roaming\npm-cache\_logs\2020-04-23T05_54_53_650Z-debug.log . – Shahidur Rahman Apr 23 '20 at 06:04
  • are you running your terminal on admin? – Rahul Purohit Apr 23 '20 at 06:39
  • Dev, thanks anyway. for your response, though it did not solve the problem. – Shahidur Rahman Apr 23 '20 at 07:25