NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'

kathir picture kathir · Dec 6, 2017 · Viewed 309k times · Source

When Creating a new Angular 5 project:

node version: 8.9.2

npm version: 5.5.1

My Command is

npm install -g @angular/cli

the Error is

npm ERR! **Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'**
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Aashitec\AppData\Roaming\npm-cache\_logs\2017-12-06T13_10_10_729Z-debug.log

the error log is http://www.aashitechno.in/2017-12-06T13_10_10_729Z-debug.log

Answer

mcemmy picture mcemmy · Dec 20, 2017

This solved it for me:

Open Windows Powershell as admin

npm cache clean --force
npm install -g @angular/cli

https://devblogs.microsoft.com/premier-developer/getting-started-with-node-js-angular-and-visual-studio-code/