create-react-app error

来源:2-5 【TypeScript配置】tsconfig.json详解

Zhang_Kyra

2021-06-16

bash-3.2$ npx create-react-app my-app-ts --template typescript

Creating a new React app in /Users/zxc/A_work/Project/UI/learning/React/my-app-ts.

warning …/…/…/…/…/…/package.json: No license field
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript…

You appear to be offline.
Falling back to the local Yarn cache.

yarn add v1.22.10
warning …/…/…/…/…/…/package.json: No license field
[1/4] 🔍 Resolving packages…

error An unexpected error occurred: “There should only be one folder
in a package cache (got in
/Users/zxc/Library/Caches/Yarn/v6/npm-@babel-helper-annotate-as-pure-7.12.13-0f58e86dfc4bb3b1fcd7db806570e177d439b6ab-integrity/node_modules/@babel)”.

写回答

1回答

阿莱克斯刘

2021-06-17

可能是你电脑的本地缓存出了问题,试试执行以下命令清除一下local cache

yarn cache clean


0
2
Zhang_Kyra
resolved. in offline mode, will hit the local cache issue.
2021-06-17
共2条回复

React18 系统精讲 结合TS打造旅游电商平台

React18 精讲 + 结合 TS 实战 + 热门业务开发,获取必备技能

1993 学习 · 1015 问题

查看课程