Divyansh Ch
Divyansh Ch

Reputation: 3

Create react app is not working correctly

D:\React>create-react-app secondapp

Creating a new React app in D:\React\secondapp.

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

npm ERR! Unexpected end of JSON input while parsing near '...2.2","is-glob":"^4.0.'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Divyansh Chaudhary\AppData\Roaming\npm-cache\_logs\2020-08-26T08_41_16_573Z-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 secondapp/ from D:\React
Done.

D:\React>

Upvotes: 0

Views: 60

Answers (2)

lanxion
lanxion

Reputation: 1430

With the newer versions of npm (version 5.2 and higher), you are recommended to use npx to use create-react-app instead. According to the create-react-app github, you are advised to

  1. uninstall create-react-app:
npm uninstall -g create-react-app
  1. clear and verify cache
npm cache verify
  1. create a react app with npx and start it like
npx create-react-app my-app
cd my-app
npm start

Upvotes: 0

Taha Habib
Taha Habib

Reputation: 32

Try:

npx create-react-app Secondapp

Upvotes: 1

Related Questions