首页 > 解决方案 > 当我想创建我的反应应用程序时出现 npm 错误

问题描述

我希望在创建我的反应应用程序期间得到您的帮助我在这里收到一条错误消息:

Microsoft Windows [版本 10.0.17763.1098] (c) 2018 Microsoft Corporation。Tous droits réservés。

C:\Users\Godson>npm --v
6.14.4

C:\Users\Godson>npm install create-react-app -g
C:\Users\Godson\AppData\Roaming\npm\create-react-app -> C:\Users\Godson\AppData\Roaming\npm\node_modules\create-react-app\index.js
+ create-react-app@3.4.1
added 10 packages from 6 contributors, removed 2 packages and updated 34 packages in 56.528s

C:\Users\Godson>npm install --global npm@latest
C:\Users\Godson\AppData\Roaming\npm\npm -> C:\Users\Godson\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
C:\Users\Godson\AppData\Roaming\npm\npx -> C:\Users\Godson\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
+ npm@6.14.4
added 435 packages from 869 contributors in 93.752s

C:\Users\Godson>npm install create-react-app -g
C:\Users\Godson\AppData\Roaming\npm\create-react-app -> C:\Users\Godson\AppData\Roaming\npm\node_modules\create-react-app\index.js
+ create-react-app@3.4.1
updated 1 package in 20.534s

C:\Users\Godson>create-react-app jeux

Creating a new React app in C:\Users\Godson\jeux.

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 '...w3bl8EeB3TQE8OQWwKsHA'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Godson\AppData\Roaming\npm-cache\_logs\2020-04-18T09_01_02_112Z-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 jeux/ from C:\Users\Godson
Done.

C:\Users\Godson>npx create-react-app jeux

Creating a new React app in C:\Users\Godson\jeux.

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 '...w3bl8EeB3TQE8OQWwKsHA'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Godson\AppData\Roaming\npm-cache\_logs\2020-04-18T09_14_27_921Z-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 jeux/ from C:\Users\Godson
Done.

C:\Users\Godson>

我试过npm cache clean --force但仍然是同样的问题这是这个命令之后出现的消息

npm WARN using --force I sure hope you know what you are doing

欢迎对此问题的解释,谢谢

标签: javascript

解决方案


推荐阅读