1
votes

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.

1
Does this answer your question? stackoverflow.com/a/47896884/2358409uminder

1 Answers

0
votes

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