最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

为什么尝试安装我的React应用程序时会不断收到错误消息

IT培训 admin 10浏览 0评论

为什么尝试安装我的React应用程序时会不断收到错误消息

这是我第一次尝试使用React,让我一次又一次看到相同的错误非常令人沮丧。我分别尝试了所有这三个代码npx create-react-app myappnpm init react-app myappnpm install -g create-react-app,然后create-react-app myapp

所有给我的东西:

npm ERR! Unexpected end of JSON input while parsing near '...:"^5.0.0 || ^6.0.0"},'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\{hiddenForPrivacyReasons}\AppData\Roaming\npm-cache\_logs\2020-04-18T14_12_44_513Z-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 D:\{hiddenForPrivacyReasons}\codes\app
Done.

帮助!

回答如下:

您不需要react-app和其他脚本

简单来说:

npx create-react-app my-app
cd my-app
npm start

参考:create-react-app的文件

为什么尝试安装我的React应用程序时会不断收到错误消息

这是我第一次尝试使用React,让我一次又一次看到相同的错误非常令人沮丧。我分别尝试了所有这三个代码npx create-react-app myappnpm init react-app myappnpm install -g create-react-app,然后create-react-app myapp

所有给我的东西:

npm ERR! Unexpected end of JSON input while parsing near '...:"^5.0.0 || ^6.0.0"},'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\{hiddenForPrivacyReasons}\AppData\Roaming\npm-cache\_logs\2020-04-18T14_12_44_513Z-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 D:\{hiddenForPrivacyReasons}\codes\app
Done.

帮助!

回答如下:

您不需要react-app和其他脚本

简单来说:

npx create-react-app my-app
cd my-app
npm start

参考:create-react-app的文件

发布评论

评论列表 (0)

  1. 暂无评论