【发布时间】: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