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

yarn install in subdirectory ignores --cwd and fails due to Corepack conflict #298

Open
navfarm opened this issue Aug 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@navfarm
Copy link

navfarm commented Aug 5, 2024

Hi @Borales

I'm using the borales/actions-yarn@v4 action in a GitHub Actions workflow to run yarn install in a specific subdirectory of my project. However, the action seems to be ignoring the --cwd option and looking at the root package.json instead of the one in the specified subdirectory.

Furthermore, I'm encountering an error related to Corepack:

error This project's package.json defines "packageManager": "yarn@[email protected]". 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  

This error suggests that Corepack might be interfering with the yarn install command and causing unexpected behavior.

I've tried the following configuration:
YAML

- name: Run install
  uses: borales/actions-yarn@v4
  with:
    cmd: install
    dir: <sub directory>

I expect the yarn install command to be executed within the specified subdirectory, using its package.json and yarn.lock files. However, it's currently affecting the entire project.

I'm looking for guidance on how to correctly configure the yarn install command to target the subdirectory and resolve the Corepack-related issue.

@Borales
Copy link
Owner

Borales commented Aug 6, 2024

I will take a look at this

@Borales Borales added the bug Something isn't working label Aug 6, 2024
@Sirrine-Jonathan
Copy link

I'm having this issue as well on my storybook addon.

@Borales
Copy link
Owner

Borales commented Dec 1, 2024

@Sirrine-Jonathan in you specific case - you have this line https://github.com/Sirrine-Jonathan/storybook-source-link/blob/main/package.json#L106 ("packageManager": "[email protected]").

actions-yarn currently suppors 1.x (classic) only.

@Sirrine-Jonathan
Copy link

@Borales Thanks!

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

3 participants