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

Error trying to use the cache option with yarn v4 and above #904

Closed
2 of 5 tasks
colenso opened this issue Nov 24, 2023 · 6 comments
Closed
2 of 5 tasks

Error trying to use the cache option with yarn v4 and above #904

colenso opened this issue Nov 24, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@colenso
Copy link

colenso commented Nov 24, 2023

Description:
Throws an error:
This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.22.21.

Action version:
4.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Node: v18
Yarn: v4.0.2

Repro steps:

  • Upgrade the yarn version in the project to v4 or above which doesn't include the yarn binary in .yarn/releases/
  • Use the cache option along with this action
  • It should spit out the error I mentioned above.

Expected behavior:
It should run successfully.

Actual behavior:
It throws the error as above.

@colenso colenso added bug Something isn't working needs triage labels Nov 24, 2023
@colenso
Copy link
Author

colenso commented Nov 24, 2023

More context:
Our project is currently using the older yarn i.e. classic and I updated it to use modern i.e. v4.0.2

@nikolai-laevskii
Copy link
Contributor

Thanks for creating the issue and providing detailed repro steps! We will look into it and come back with details!

@ravenberg
Copy link

Underneath the error message you posted was the following hint.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.

After which I enabled corepack using the command

corepack enable

And that fixed my issue.

@dmitry-shibanov
Copy link
Contributor

Hello everyone. For now I'm going to close the issue as duplicate of #899. If you have any concerns feel free to ping us.

@dmitry-shibanov dmitry-shibanov closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2023
@tiavina-mika
Copy link

in your yaml workflow file add:

      - name: Enable Corepack
        run: corepack enable

@JoseAlban
Copy link

in your yaml workflow file add:

      - name: Enable Corepack
        run: corepack enable

That worked for me as well :) thanks for sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants