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.
3
  • npm cache clean --force try Commented Jul 24, 2018 at 7:39
  • Look at this question and its first answer: stackoverflow.com/questions/47675478/… Commented Jul 24, 2018 at 7:39
  • Please check the answer and mark as resolved if it solves your query. Commented Jul 26, 2018 at 20:48

1 Answer 1

5

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!!

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, but didn't work for me :(

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.