2

I am just beginning my coding journey and I am just starting out with react but when I try creating a new app, I get the following error. It says unexpected end of JSON input.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

npm ERR! Unexpected end of JSON input while parsing near '...gin-precompile- 
charco'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2018-07- 
24T07_21_16_208Z-debug.log

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react- 
scripts has failed.

Deleting generated file... package.json
Deleting robofriends / from C:\Users\vaibh\Desktop
Done.
MarmiK
  • 5,639
  • 6
  • 40
  • 49
Vaibhav Kumar
  • 19
  • 2
  • 5

1 Answers1

4

It is due to the npm cache.

You can solve it by:

npm cache clean --force

Also, make sure your npm is updated to the latest.

npm i npm@latest -g

And try again!!

Harshal Yeole
  • 4,812
  • 1
  • 21
  • 43