0
votes

npm version = 6.14.4

node version = v12.16.2

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 '...79WvYfkfE4XCeqsdvhNxl'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\divya\AppData\Roaming\npm-cache_logs\2020-04-26T11_35_57_318Z-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 firstproj/ from C:\Users\divya\React Done.

3

3 Answers

0
votes

Try to clear the npm cache,

execute this command:

npm cache clean --force

If this doesn't work, delete the complete npm cache and npm files from the app data folder and re-install it completely.

from the following path, you can find AppData folder

C:\Users\divya\AppData\Roaming

0
votes

So, apparently the issue is from npm and non of us has done anything wrong.

try this : npm install -g --force create-react-app

if did not work,still we can use Yarn to start a new react project while they solve it, follow the steps:

step 1: yarn init -y

step 2: Insert this to package.json

"resolutions": {
    "is-promise": "2.1.0",
    "run-async/is-promise": "2.1.0"
  }

step 3: yarn add --dev create-react-app

step 4: yarn create-react-app ../my-app

0
votes

I was also facing almost same type of problem. But then tried

yarn create react-app my-app

in power shell with admin privilege which seemed to do the trick.

Also you’ll need to have Node >= 8.10, yarn >= 0.25+ on your machine as the official doc suggests. Hope this helps.