Reactjs 无法使用“创建react应用程序”;创建react应用程序“;

Reactjs 无法使用“创建react应用程序”;创建react应用程序“;,reactjs,create-react-app,Reactjs,Create React App,我已经使用“npm安装创建反应应用程序-g”在我的电脑上全局安装了“创建反应应用程序”。几个月来,它一直运作良好。我以前使用“createreact-app-name”命令创建了很多react-app。它工作得非常完美。直到几天前,它突然停止工作,开始出错。我尝试过各种建议,但都没有成功。因此,经过几天的努力解决这个问题后,我提出了这个问题 我试过做以下几件事: 1> using the "npm cache clean --force" and then "npm cache verif

我已经使用“npm安装创建反应应用程序-g”在我的电脑上全局安装了“创建反应应用程序”。几个月来,它一直运作良好。我以前使用“createreact-app-name”命令创建了很多react-app。它工作得非常完美。直到几天前,它突然停止工作,开始出错。我尝试过各种建议,但都没有成功。因此,经过几天的努力解决这个问题后,我提出了这个问题

我试过做以下几件事:

1> using the "npm cache clean --force" and then "npm cache verify".
2> I also unabled my antivirus (norton) and then ran the commands.
3> I installed the latest node version
4> I intalled the latest npm version and updated it using the command "npm install npm@latest -g"
5> I followed the instructions on this stackoverflow link https://stackoverflow.com/questions/50189096/installing-create-react-app-gives-npm-err-shasum-check-failed-and-npm-err-unex/50191315#50191315 to change the registry.
And a few other things. But nothing has worked.
我得到的错误如下:

D:\codes\react\maximilianUdemy\project1>create-react-app react-mytest-app

Creating a new React app in D:\codes\react\maximilianUdemy\project1\react-mytest-app.

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

npm ERR! Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting react-mytest-app/ from D:\codes\react\maximilianUdemy\project1
Done.
下面是
C:\Users\vaibh\AppData\Roaming\npm cache\\u logs\2019-07-20T10\u 24\u 27\u 969Z-debug.log
的摘录。由于日志非常大(664行),我只注意到错误开始显示的时间

471 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
471 verbose stack     at JSON.parse (<anonymous>)
471 verbose stack     at parseJson (D:\Program_Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
471 verbose stack     at D:\Program_Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
471 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:85:5)
472 verbose cwd D:\codes\react\maximilianUdemy\project1\react-mytest-app
473 verbose Windows_NT 10.0.17134
474 verbose argv "D:\\Program_Files\\nodejs\\node.exe" "D:\\Program_Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
475 verbose node v12.6.0
476 verbose npm  v6.9.0
477 error Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
478 verbose exit [ 1, true ]
471详细堆栈语法错误:在“…HqQqP7Ky/f49Ar0oPZ\n4”附近解析时JSON输入意外结束
471 JSON.parse()处的详细堆栈
471 parseJson处的详细堆栈(D:\Program\u Files\nodejs\node\u modules\npm\node\u modules\json parse better errors\index.js:7:17)
471详细堆栈位于D:\Program\u Files\nodejs\node\u modules\npm\node\u modules\node fetch npm\src\body.js:96:50
471 processTicksAndRejections的详细堆栈(internal/process/task_queues.js:85:5)
472详细cwd:\codes\react\maximilianUdemy\project1\react mytest应用程序
473详细窗口\u NT 10.0.17134
474详细argv“D:\\Program\u Files\\nodejs\\node.exe”“D:\\Program\u Files\\nodejs\\node\u modules\\npm\\bin\\npm cli.js”“install”“--save”“--save-exact”“--loglevel”“error”“react”“react”“react dom”“react scripts”
475详细节点v12.6.0
476详细npm v6.9.0
477错误解析“…hqqp7ky/f49Ar0oPZ\n4”附近时JSON输入意外结束
478详细退出[1,true]

尝试使用
npx create react app my app


我认为中的信息也会对您有所帮助。

这个问题是相对于节点版本创建react应用程序版本

创建新项目

npx创建react应用程序项目\u名称——模板全部


尝试此
npx create react app react mytest app
尝试使用npm uninstall-g create react卸载并重新安装-app@ravibagul91我也试过了。它也给出了同样的结果error@Sushilzzz我以前更新过npm,但它不起作用。我已按您所说的卸载并重新安装,但仍会出现相同的错误。请尝试删除
C:\Users\\AppData\Roaming\npm cache
下的所有内容。问题是什么?你已经试过什么了?尝试运行上述命令时出现了哪些错误消息?