Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Unexpected end of JSON input while parsing near '...ge-2.2.1.tgz"},"engin'

Command:

npm install -g @angular/cli@latest

Exception:

verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ge-2.2.1.tgz"},"engin' 169 verbose stack at JSON.parse () 169 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17) 169 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50) 169 verbose stack at 169 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)


Looking for help and support. Thanks

like image 901
Arvind Gautam Avatar asked Jul 26 '18 03:07

Arvind Gautam


2 Answers

npm cache clean --force 

Then :

npm install -g @angular/cli

If not working :

Delete package.lock.json file and try again

like image 141
willmaz Avatar answered Oct 13 '22 06:10

willmaz


I started facing this issue after upgrading npm package.

You can resolve this with: npm cache clean --force

voila, reinstall the package.

like image 27
Prasanna Jathan Avatar answered Oct 13 '22 07:10

Prasanna Jathan