Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! Unexpected end of JSON input while parsing near '...npmjs.org/prelude-ls/'

Tags:

angular-cli

Trying to run:

npm install @angular-devkit/build-angular

Getting below while installing

npm ERR! Unexpected end of JSON input while parsing near '...npmjs.org/prelude-ls/'

Please help

like image 614
Nilesh Avatar asked Sep 22 '18 14:09

Nilesh


1 Answers

Cleaning the corrupted local npm cache may fix this error.

npm cache clean --force

Just run your npm command again after executing the above command in your terminal.


There could be few other reasons for the invalid JSON, as described in the official documentation here.

The official npm website has well documented most of the common errors. But unfortunately they don’t appear on the top results when you google the error.

like image 93
Abbas Siddiqi Avatar answered Sep 24 '22 15:09

Abbas Siddiqi