我正在试验纱线 2 和 faceplanting。
我创建了一个新文件夹:/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] ...
我究竟做错了什么?