首页 > 解决方案 > 创建反应应用程序时获取包失败

问题描述

我正在尝试使用创建反应应用程序:npx create-react-app my-app 并且我不断收到此错误:

Creating a new React app in /Users/mcohen/Git/andys-tale/andys-blog.

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

yarn add v1.12.3
[1/4]   Resolving packages...
[2/4]   Fetching packages...
error https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "Unexpected end of data"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts --cwd /Users/mcohen/Git/andys-tale/andys-blog has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting andys-blog/ from /Users/mcohen/Git/andys-tale
Done.

有什么建议我该怎么办?

标签: reactjscreate-react-app

解决方案


删除 yarn.lock 文件 这会有所帮助!


推荐阅读