npx create-react-app拉下以下错误消息

发布于 2025-02-12 01:27:19 字数 843 浏览 0 评论 0原文

当我尝试创建一个React应用程序时,在命令行中生成以下内容。可能的问题/解决方案是什么?

johnsmith@johnsmith-MacBook-Pro portfolio-projects % npx create-react-app watch-this

Creating a new React app in /Users/johnsmith/Code/portfolio-projects/watch-this.

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

npm ERR! code Z_DATA_ERROR
npm ERR! errno -3
npm ERR! zlib: incorrect data check

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/johnsmith/.npm/_logs/2022-06-30T16_47_23_299Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting watch-this/ from /Users/johnsmith/Code/portfolio-projects
Done.```

The following is generated in the command-line when I try to create a React app. what is the possible issue/solution?

johnsmith@johnsmith-MacBook-Pro portfolio-projects % npx create-react-app watch-this

Creating a new React app in /Users/johnsmith/Code/portfolio-projects/watch-this.

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

npm ERR! code Z_DATA_ERROR
npm ERR! errno -3
npm ERR! zlib: incorrect data check

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/johnsmith/.npm/_logs/2022-06-30T16_47_23_299Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting watch-this/ from /Users/johnsmith/Code/portfolio-projects
Done.```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小傻瓜 2025-02-19 01:27:19

只需卸载 node- v14.17.3 并安装最新版本的节点和您'将摆脱这个错误

Just uninstall node- v14.17.3 and install the latest version of node and you'll get rid of this error

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文