【问题标题】:npx create-react-app pulls the following error messagenpx create-react-app 提取以下错误消息
【发布时间】:2022-07-01 13:41:31
【问题描述】:

当我尝试创建 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.```

【问题讨论】:

  • 你用的是什么版本的node.js和npm??
  • 节点-v14.17.3 npm-8.3.2

标签: reactjs create-react-app


【解决方案1】:

只需卸载 node- v14.17.3 并安装latest version of node,您将摆脱此错误

【讨论】:

    猜你喜欢
    • 2018-11-05
    • 1970-01-01
    • 2021-06-04
    • 2021-04-24
    • 2021-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多