-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Yarn v1.22.21 introduces new issue when using Corepack #9015
Comments
It also breaks actions/setup-node: actions/setup-node#899 (comment) |
Why is |
Also note that this also kinda matches how Corepack itself works: calling any pnpm command on a Yarn project yields an error, and the other way around (unless |
Yeah, if a project states its preferred package manager, and that isn’t Yarn, it shouldn’t work in the first place. This probably shouldn’t have been shipped in a semver-patch release, but still. |
In my case, this happened when running tests against fixtures that specify different |
this happened to me on a project that uses yarn 3.2.4 during the build with github actions (running
|
There's something strange I need help understand. This message is only supposed to show up if all of those conditions are true:
My assumption writing this check was that if we didn't error, then Yarn 1.x would silently perform the install, not 3.x nor 4.x. Did I make a mistake? Can you check your logs before the 1.22.21 release and confirm the installs were performed by Yarn 3.x / 4.x? If it was working well, then something is off in the condition that we definitely should understand and fix. |
sorry @arcanis disregard my case - for some reason [email protected] was set as the packageManager in the package.json but there was no .yarn dir at all. possibly I used it and rolled back to classic yarn and it didn't care about the packageManager field before 1.22.21 and only did checks on the .yarn dir |
I've had same issues with both projects that has a |
Workaround for deploy errors caused by yarnpkg/yarn#9015
This dockerfile allowed me to test different versions of yarn in order to find the version at which this new issue presented. It appears to be 1.22.20
|
@john-ciq if you have corepack enabled you shouldn't add Yarn globally. In that case, the issue is happening because |
Downgrade to [email protected] work for me, |
Thanks for pointing that out, @RDIL. I included corepack as that was what my particular use case was. I removed corepack and can still reproduce the issue. yarn 1.22.19 works when packageManager specifies [email protected], but yarn 1.22.20 fails with this message:
Dockerfile to reproduce:
|
Running your example with the
That's why we have the warning: if Corepack isn't enabled, the |
Thanks for the help and explanation, @arcanis. I did have to set COREPACK_ROOT as well as SKIP_YARN_COREPACK_CHECK, as per https://github.com/yarnpkg/yarn/blob/1.22-stable/src/cli/index.js#L292C21-L292C33 But all is well now, thank you! |
Can a fix be added to not opt people into this change by default? We have users that use
Which is a false error because the projects are not part of that workspace and are being treated as such. |
@Aghassi, that situation seems similar to mine. If possible, you may be able to avoid the error by setting both |
Sorry, but that's not scalable nor an acceptable answer for an entire engineering org to adopt just to revert back to functionality that we had yesterday. It's nice there is an eject, but this shouldn't be needed. It's a breaking change in my book and should have been on a separate major version of Yarn. 1.22 was end of life and we were under the impression it was not receiving any other changes. Users should be pinned in our org but we may also have folks who accidentally upgrade their yarn and end up in this situation. |
@Aghassi It does seem like a breaking change, though I can't speak for yarn contributors or maintainers. The solution I came to was to force an install of yarn 1.22.19. |
Yeah that's the solution we came to also sadly |
This error throws on yarn 4.0.2 and a dependency uses another package manager to run its scripts. In my case, we depend on abort-controller-es5 and its postinstall script is This may be an issue with corepack and not yarn, I'm not sure |
This issue should be brought up since it effecting me to use my package manager |
For anyone who is the having the same issue I would enable it and then do |
* chore: migrate to pnpm * feat(app-vite&app-webpack): improve package manager references in banners * chore: remove npm reference in dev app uploader page * docs: upgrade contribution guide * chore: correctly include extras in workspaces * chore: include create-quasar in workspaces * chore: centralize .editorconfig * chore: remove yarn.lock * chore: only allow pnpm * chore: centralize linting packages and config * chore: create shared eslint config package * chore: remove redundant pnpm.peerDependencyRules.ignoreMissing it needs to be specified in the root since we are using pnpm workspaces but, it doesn't seem to be changing any behavior, so it's redundant * chore: include cli in workspaces * ci: ensure pnpm is installed and cache is set correctly * chore: generate pnpm lock file after rebase * chore: tidy up eslintignore * chore: setup root lint script * chore: include app-webpack in workspaces * chore: update vscode config * chore: update .github/CONTRIBUTING.md * chore: regenerate lock file * ci: fix create test project script after migrating to pnpm workspaces, some behavior got changed 1. prompts package named imports are not working. This is probably due to switching to a different version during migration, rather than a pnpm specific issue. 2. When using pnpm to create the test project, it becomes part of the monorepo, which makes it fail to install properly. * ci: fix weird test creation test issue with yarn * Revert "ci: fix weird test creation test issue with yarn" This reverts commit 5fcaa12. * ci: fix weird test creation test issue with yarn yarnpkg/yarn#9015 * ci: apply skip yarn corepack check to other scripts as well but still keep it in create-test-project script to avoid the problem when executing the script in different environments * ci: cache Cypress binary to fix tests on pr workflow * ci: install Cypress binary when cache does not exit and correctly cache it * chore(ui): fix tests not being able to run
I have the sam issue on a node 12 project and the package.json doesn't even define a package manager.
|
Corepack doesn't make up this string (outside of the |
Maybe it would be best if this check states the exact path of the package.json it's found it in? |
But for Yarn I really shouldn't have to do this setup but I guess it's temporarily. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I've received this error while trying to test yarn upgrade and downgrade:
The problem is actually that latest classic release checks The solution for me is to use some old stable version instead of classic. |
The latest The
When we build an image, the final image do not include the |
@lawrenceong consider setting |
This is quite a footgun over here. Turns out it's affecting all my Yarn projects that don't even have |
Seems like a847238 introduces a false-positive when the
packageManager
field specifies a package manager that is notyarn
.This dockerfile demonstrates the issue:
I would expect yarn to ignore this check in the case of
packageManager
not being yarn.The text was updated successfully, but these errors were encountered: