0

here is the img description of the error

first it creates the folder (my-app), but after a few seconds it will be removed automatically. Either I installed the latest version of node.js.

$ npx create-react-app my-app npx : 98 installé(s) en 23.154s

Creating a new React app in D:\Mon-Travail-Personnel\my-work-with-REACT\my-app.

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

until know it's good but after : ** npm ERR! Unexpected end of JSON input while parsing near '...rg\r\n\r\nwsFcBAEBCAA'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\khith\AppData\Roaming\npm-cache_logs\2020-05-29T16_51_36_753Z-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:\Mon-Travail-Personnel\my-work-with-REACT Done. **

  • 1
    Check this [StackOverflow question](https://stackoverflow.com/questions/47675478/npm-install-errorunexpected-end-of-json-input-while-parsing-near-nt-webpack). It probably tackles your problem – ItzaMi May 29 '20 at 17:17

2 Answers2

0

Could you try this,

  1. Clear cache: npm cache clean --force
  2. Install create-react-app globally: npm i create-react-app -g
  3. Create your React project: create-react-app my-app

The problem should mostly be resolved with Step 1.

Ramaraja
  • 2,526
  • 16
  • 21
  • with the answer one . it's not working . one person told me re install the Node js. i did thaaat . then it works . thank you so much bro – khiter med achraf May 29 '20 at 20:48
0

You should try using a different network, either a different Wi-Fi network or using a mobile hotspot. Then, try again to create the react app: npx create-react-app <project_name>.

Hope this should help you.This Works For me.

Is this okay with you?