Reactjs 执行createreact应用程序时出错
当我运行CreateReact应用程序我的新应用程序时,出现以下错误。我的npm版本是6.1.0,节点版本是8.11.3Reactjs 执行createreact应用程序时出错,reactjs,npm,Reactjs,Npm,当我运行CreateReact应用程序我的新应用程序时,出现以下错误。我的npm版本是6.1.0,节点版本是8.11.3 $ create-react-app my-new-app Creating a new React app in C:\Users\home\Desktop\Web Development\7. React\my-new-app. Installing packages. This might take a couple of minutes. Installing
$ create-react-app my-new-app
Creating a new React app in C:\Users\home\Desktop\Web Development\7.
React\my-new-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 '...ectories":
{},"dist"
:{'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\home\AppData\Roaming\npm-cache\_logs\2018-06-
16T12_46_38_1
22Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-
scripts
has failed.
Deleting generated file... package.json
Deleting my-new-app / from C:\Users\home\Desktop\Web Development\7. React
Done.
请尝试以下命令:
npm cache clean --force
也许你有一个过时的create-react应用程序版本 如果你有npm 6,那么你也有npx。使用npx,您只需执行以下操作:
npx create-react-app my-new-app
它将使用最新的CreateReact应用程序,即使你没有安装它。
检查如果问题仍然存在,请尝试重新安装create react应用程序。我重新安装了create react应用程序,但我得到了相同的结果。我重新安装了create react应用程序,甚至尝试了npx,但都不起作用。执行命令后,您是否尝试重新安装create react应用程序,然后创建项目