I’m working on a project with the following setup:
- Node v20.15.0
- Yarn v4.2.2
- Corepack enabled
I have two packages in the dependencies
section of my package.json
:
"dependencies": {
"first-package": "git+ssh://[email protected]:group/first-package.git#v2.4.0",
"second-package": "git+ssh://[email protected]:group/second-package.git#v3.0.1"
}
During the installation of the project on macOS, I encounter checksum errors for these two packages. The error messages are as follows:
➤ YN0018: │ first-package@git+ssh://[email protected]:group/first-package.git#commit=commit-hash: The remote archive doesn't match the expected checksum
➤ YN0018: │ second-package@git+ssh://[email protected]:group/second-package.git#commit=commit-hash: The remote archive doesn't match the expected checksum
Interestingly, there are no errors on Linux and Windows installations.
Upon investigating the packages within the node_modules
folder, we discovered that the installation on macOS adds a packageManager
field to the package.json
of the packages downloaded from the git server. It seems this alteration is causing the checksum mismatch.
I found and reviewed these GitHub issues:
Yarn Issue #2399
Yarn Issue #4917
Unfortunately, they did not provide a solution to my problem.
We also tried adding the following to package.json:
"dependenciesMeta": {
"first-package": { "built": false },
"second-package": { "built": false }
}
However, this did not resolve the issue either.
Question: How can I prevent the addition of the packageManager
field to my git packages on macOS to ensure checksum consistency?
Any help or insights would be greatly appreciated!