Commit 3ad3052
authored
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.1 parent 157da5c commit 3ad3052
File tree
2 files changed
+35
-1
lines changed- .yarn/versions
- packages/yarnpkg-core/sources
2 files changed
+35
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
0 commit comments