简体   繁体   中英

Create React app with Create-React-App fails with ERR! Unexpected end of JSON input while parsing near '…er“:”^2.0.0“,”eslint"'

I used the following command to create a React application using Create-React-App tool:

C:\Users\Valdo\Desktop\Test\React>npx create-react-app my-app

But I encountered an error, here is my terminal log:

Creating a new React app in C:\Users\Valdo\Desktop\Test\React\my-app.

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 '...fdd1679ff","tarball":'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Valdo\AppData\Roaming\npm-cache_logs\2020-04-23T16_44_10_449Z-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 C:\Users\Valdo\Desktop\Test\React

Try to npm cache clean --force first and then run your command again, this might solve your problem.

This will delete all data from the cache folder that may be responsible for your error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM