Skip to content

#2627: Fix corepack hijacking yarn installation - #2691

Open
MeShehi wants to merge 1 commit into
devonfw:mainfrom
MeShehi:2627_corepack_replaces_yarn
Open

MeShehi wants to merge 1 commit into
devonfw:mainfrom
MeShehi:2627_corepack_replaces_yarn

Conversation

@MeShehi

@MeShehi MeShehi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes #2627

Implemented changes:

Instead of relying on the shared PATH launcher, run yarn's own entry point (yarn/bin/yarn.js under the npm global prefix) via the IDEasy-managed node runtime. Falls back to the previous behavior when the entry point is not available.

Testing instructions

To confirm the fix, compare the same commands from the issue ticket:

  1. ide install yarn
  2. ide yarn --version prints 2.4.3
  3. ide install corepack
  4. ide yarn --version prints 2.4.3
  5. ide uninstall yarn: no errors

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat).
    If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed,
    you have updated our LICENSE.adoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

…cking the yarn launcher

yarn and corepack both provide a 'yarn' launcher in the shared global npm
prefix. Since devonfw#1545 IDEasy installs global packages with 'npm install -gf',
so whichever tool is installed last overwrites the launcher of the other.

Instead of relying on the shared PATH launcher, run yarn's own entry point
(node <prefix>/node_modules/yarn/bin/yarn.js) via the IDEasy-managed node
runtime. Falls back to the previous behavior when the entry point is not
available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

Installing corepack replaces the yarn launcher installed by IDEasy

1 participant