botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

Cannot Yarn Add in ui-admin #1578

Closed ptrckbp closed 2 years ago

ptrckbp commented 2 years ago

Describe the bug In the master branch, cannot add packages (or update) in the ui-admin folder.

  Invariant Violation: expected workspace package to exist for "@types/mkdirp"
      at invariant (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:2314:15)
      at _loop2 (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:94537:9)
      at PackageHoister.init (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:94596:19)
      at PackageLinker.getFlatHoistedTree (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:48744:20)
      at PackageLinker.<anonymous> (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:48755:27)
      at Generator.next (<anonymous>)
      at step (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:310:30)
      at /Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:328:14
      at new Promise (<anonymous>)
      at new F (/Users/username/.nvm/versions/node/v12.13.0/lib/node_modules/yarn/lib/cli.js:5301:28)

To Reproduce Steps to reproduce the behavior:

  1. Clone botpress/botpress (master branch). Pull if you already have it.
  2. nvm use (optional)
  3. yarn && yarn build
  4. yarn start (just to make sure everything works)
  5. yarn workspace @botpress/ui-admin add axios@latest

Alternatively, you can cd in packages/ui-admin and run yarn add axios@latest.

Expected behavior It should install the latest version of axios, or whatever you want to install.

Environment (please complete the following information):

Additional context Was able to reproduce on @daehli's Mac too. He had to pull to the latest master to make it fail.

laurentlp commented 2 years ago

Temporary workaround:

Run:

yarn policies set-version 1.18.0
yarn workspace @botpress/ui-admin add axios@latest
ptrckbp commented 2 years ago

Thanks @laurentlp that did the trick. If we aren't going to upgrade to Yarn 2 anytime soon, maybe we could add the yarn version in the package.json (although that might get annoying).

laurentlp commented 2 years ago

@ptrckbp, glad it worked. Our goal is to gradually upgrade to yarn >= 2. So, once this is done for all packages, I think we will get rid of this issue!