簡體   English   中英

使用 Create-React-App 創建 React 應用程序失敗並出現 ERR:在“…er”附近解析時,JSON 輸入意外結束。”^2.0,0“,”eslint”'

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

我使用以下命令使用 Create-React-App 工具創建了一個 React 應用程序:

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

但是我遇到了一個錯誤,這是我的終端日志:

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

首先嘗試npm cache clean --force然后再次運行您的命令,這可能會解決您的問題。

這將從緩存文件夾中刪除可能導致您的錯誤的所有數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM