1

Always give an error message when i try to install angular using this npm install -g@angular/cli

PS C:\Users\admin\Desktop\sonal> npm install -g @angular/cli npm ERR! Unexpected end of JSON input while parsing near '...EGIN PGP SIGNATURE---'

npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\admin\AppData\Roaming\npm-cache_logs\2020-07-12T09_04_02_173Z-debug.log.

For this we use node version 12.18.0 and npm version 6.14.6.Please help me for solving this error.

Jithin Scaria
  • 1,271
  • 1
  • 15
  • 26

1 Answers1

0

step 0: run this command

npm uninstall -g @angular/cli

npm cache clean

step 1: delete this folder: C:\Users%YOUR-USERNAME%\AppData\Roaming\npm

step 2: uninstall Nodejs from Windows

step 3: restart your PC

step 4: install a fresh copy of Nodejs from here:Link

step 5: install the CLI globally

npm install -g @angular/cli@latest

Jay Parmar
  • 368
  • 2
  • 9
  • Thank u for this solution@Jay Parmar.I tried but it not worked for me. I again find the same error.Please suggest any other solution for this problem@ Jay Parmar.. – priya gupta Jul 13 '20 at 07:10