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

fix(cli): Set COREPACK_ENABLE_AUTO_PIN=0 during local pack of github packages #6529

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

islandryu
Copy link
Contributor

@islandryu islandryu commented Sep 29, 2024

Different Corepack versions caused discrepancies in the addition of packageManager during Yarn installation, resulting in checksum changes and installation failures. This commit standardizes the behavior to avoid such errors.

What's the problem this PR addresses?

issue

Error occurs because checksum changes with different corepack versions.

repro

  "dependencies": {
    "react-native-scrollable-tab-view": "https://github.com/ptomasroos/react-native-scrollable-tab-view#74c3ce7332c706732ef0e590c31e6558e8c0f2d5"
  }

When I generate yarn.lock with corepack0.18.0 and install with 0.29.4, I get the following error.

react-native-scrollable-tab-view@https://github.com/ptomasroos/react-native-scrollable-tab-view.git#commit=74c3ce7332c706732ef0e590c31e6558e8c0f2d5: The remote archive doesn't match the expected checksum

This is at least the environment in which it occurred to me.
I also think it probably occurs in any github url

why

The github pakcage is packed locally by running the yarn pack command
It seems that corepack changes the checksum of the package by setting the packageManager field to package.json when this command is executed.

How did you fix it?

Set COREPACK_ENABLE_AUTO_PIN to not add packageManager field

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@islandryu islandryu changed the title fix(core): Set COREPACK_ENABLE_AUTO_PIN=0 during local pack of github packages fix(cli): Set COREPACK_ENABLE_AUTO_PIN=0 during local pack of github packages Sep 29, 2024
…packages

Different Corepack versions caused discrepancies in the addition of `packageManager` during Yarn installation, resulting in checksum changes and installation failures. This commit standardizes the behavior to avoid such errors.
@islandryu islandryu marked this pull request as ready for review September 29, 2024 08:40
@arcanis arcanis merged commit 3ad3052 into yarnpkg:master Oct 15, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants