gpt4 book ai didi

yarn-v2 - 初始化 yarn 2,添加失败

转载 作者:行者123 更新时间:2023-12-03 16:20:19 31 4
gpt4 key购买 nike

我正在试验2号纱和植面。
我创建了一个新文件夹:/projects/yarn2/根据他们的安装指南https://yarnpkg.com/getting-started我跑了

cd /projects/yarn2/
yarn set version berry
yarn init
然后(按照他们的指南 https://yarnpkg.com/getting-started/usage) yarn add react并得到以下错误:
Usage Error: The nearest package directory (/projects/yarn2) doesn't seem to be part of the project declared in /projects.

- If the project directory is right, it might be that you forgot to list yarn2 as a workspace.
- If it isn't, it's likely because you have a yarn.lock or package.json file there, confusing the project root detection.

$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] ...
我究竟做错了什么?

最佳答案

检查/projects目录中是否有package.jsonyarn.lock文件。如果这样做,请清除/清除它们,然后它应该开始工作。

关于yarn-v2 - 初始化 yarn 2,添加失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64048830/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com