Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add a package[Bug] #3994

Closed
Zmnortal opened this issue Mar 17, 2024 · 3 comments
Closed

Unable to add a package[Bug] #3994

Zmnortal opened this issue Mar 17, 2024 · 3 comments
Labels
Awaiting Reproduction Can we reproduce the reported bug?

Comments

@Zmnortal
Copy link

Describe the Bug

I tried to modify some code myself and wanted to install some packages, but failed. The following error occurred during installation.

error Invariant Violation: expected workspace package to exist for "style-loader"
at invariant (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:2318:15)
at _loop2 (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:91560:9)
at PackageHoister.init (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:91619:19)
at PackageLinker.getFlatHoistedTree (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:48551:20)
at PackageLinker. (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:48562:27)
at Generator.next ()
at step (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:310:30)
at /Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:328:14
at new Promise ()
at new F (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:5539:28)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
error Command failed.

Steps to Reproduce

  1. download project
  2. try install a new project to a workspace eg: yarn workspace @ohif/ui add dayjs
  3. get error

The current behavior

Not able to install any package I think.

error Invariant Violation: expected workspace package to exist for "style-loader"
at invariant (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:2318:15)
at _loop2 (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:91560:9)
at PackageHoister.init (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:91619:19)
at PackageLinker.getFlatHoistedTree (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:48551:20)
at PackageLinker. (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:48562:27)
at Generator.next ()
at step (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:310:30)
at /Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:328:14
at new Promise ()
at new F (/Users/zhangziyi/.nvm/versions/node/v16.20.2/lib/node_modules/yarn/lib/cli.js:5539:28)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
error Command failed.

The expected behavior

Can install packages.

OS

macOS 14.1.1

Node version

16.20.2

Browser

not related

@Zmnortal Zmnortal added the Awaiting Reproduction Can we reproduce the reported bug? label Mar 17, 2024
@sedghi
Copy link
Member

sedghi commented Mar 20, 2024

seems like a yarn compatibility problem and if you set yarn to 1.19 it is fixed

@sedghi
Copy link
Member

sedghi commented Mar 20, 2024

yarnpkg/yarn#7807

@Zmnortal
Copy link
Author

Thanks, I downgrade to version 1.18 and install it successfully. This was really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reproduction Can we reproduce the reported bug?
Projects
None yet
Development

No branches or pull requests

2 participants