0

This is my first time trying out React and it's very demoralising to keep seeing the same error over and over again. I tried all three of these codes seperately
npx create-react-app myapp
npm init react-app myapp
npm install -g create-react-app then create-react-app myapp

All which gave me:

npm ERR! Unexpected end of JSON input while parsing near '...:"^5.0.0 || ^6.0.0"},'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\{hiddenForPrivacyReasons}\AppData\Roaming\npm-cache\_logs\2020-04-18T14_12_44_513Z-debug.log

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

Deleting generated file... package.json
Deleting my-app/ from D:\{hiddenForPrivacyReasons}\codes\app
Done.

Help!!!

zS1L3NT
  • 461
  • 5
  • 14
  • Have you tried this? https://stackoverflow.com/questions/47675478/npm-install-errorunexpected-end-of-json-input-while-parsing-near-nt-webpack – David Apr 18 '20 at 14:26

1 Answers1

1

You don't need react-app and other scripts

Simply:

npx create-react-app my-app
cd my-app
npm start

Refer: document of create-react-app

keikai
  • 14,085
  • 9
  • 49
  • 68