问题描述
我一直在尝试对工作中的项目执行 yarn install
和 yarn
,但由于某种原因,它一直显示相同的消息,我无法删除 @tspnm/uikit,因为它正在多处使用。
节点版本为 15.13.0
纱线版本 1.22.5
和 npm 版本 7.7.6。
我尝试执行 yarn cache clean
然后执行 yarn
仍然相同,我也尝试删除 yarn.lock
文件并得到相同的结果。
解决方法
移除旧的 react-native-cli
npm uninstall -g react-native-cli
从“react-native-community”安装新的:
npm i -g @react-native-community/cli
之后,使用以下命令初始化项目:
npx react-native init MyApp --template react-native-template-typescript