Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): Set COREPACK_ENABLE_AUTO_PIN=0 during local pack of github …
…packages (#6529) 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? <!-- Describe the rationale of your PR. --> <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> ### issue Error occurs because checksum changes with different corepack versions. ### repro ``` json "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 <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [ ] I will check that all automated PR checks pass before the PR gets reviewed.
- Loading branch information