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

If cache: yarn is specified, this action fails #1027

Open
2 of 5 tasks
esperecyan opened this issue May 1, 2024 · 4 comments
Open
2 of 5 tasks

If cache: yarn is specified, this action fails #1027

esperecyan opened this issue May 1, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@esperecyan
Copy link

Description:
If I set packageManager property in package.json and set cache: yarn in this action, this action will fail.

Related:

Action version:
v4 (v4.0.2)

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

  • yarn 4.1.1

Repro steps:
This is the workflow that reproduced this issue with the minimum configuration.
https://github.com/esperecyan/actions-setup-node-debug/actions/runs/8907795048/workflow
You can confirm that the issue does not occur in the following cases:

  • If I set npm to packageManager.
  • If I set yarn to packageManager and do not set cache: yarn for this action.

Expected behavior:
actions/setup-node succeeds.

Actual behavior:
actions/setup-node fails with the following error.

Error: error This project's package.json defines "packageManager": "yarn@4.1.1". However the current global version of Yarn is 1.22.22.

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.
https://github.com/esperecyan/actions-setup-node-debug/actions/runs/8907795048/job/24462266566

Running corepack enable before actions/setup-node will avoid this issue.
https://github.com/esperecyan/actions-setup-node-debug/actions/runs/8907795048/job/24462266822

@esperecyan esperecyan added bug Something isn't working needs triage labels May 1, 2024
@HarithaVattikuti
Copy link
Contributor

Hello @esperecyan
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 3, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 3, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 3, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 4, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 4, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 4, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 9, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 9, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 10, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 10, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 10, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 10, 2024
mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue May 10, 2024
@1kevgriff
Copy link

Hitting this today too.

ilharp added a commit to koishijs/koishi-desktop that referenced this issue May 12, 2024
@mahabaleshwars mahabaleshwars self-assigned this May 23, 2024
ilharp added a commit to koishijs/koishi-desktop that referenced this issue May 31, 2024
@n0099
Copy link

n0099 commented Jun 10, 2024

#901
#546
#480

n0099 added a commit to n0099/open-tbm that referenced this issue Jun 10, 2024
$ yarn add -D @typescript-eslint/{parser,eslint-plugin}@npm:rc-v8
$ yarn dedupe
$ yarn set version latest # fix yarnpkg/berry#6219
* remove `yarnPath` to prefer corepack @ .yarnrc.yml
@ fe

* run `corepack enable` to fix actions/setup-node#1027
@ .github/actions/fe/action.yml
@SunsetTechuila
Copy link

Running corepack enable before actions/setup-node will avoid this issue.

works only for node 18+

for node 14-16 see #1075 (comment)

mihirsamdarshi added a commit to MoTrPAC/motrpac-frontend that referenced this issue Jul 1, 2024
tiziodcaio added a commit to tiziodcaio/react that referenced this issue Sep 5, 2024
tiziodcaio added a commit to tiziodcaio/react that referenced this issue Sep 15, 2024
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