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(corepack): specify explicit pnpm version to avoid signature verif… #1327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MahaKoala
Copy link

fix(corepack): specify explicit pnpm version to avoid signature verification error on M3 macOS fresh installs

Description

Problem:
Some M3 macOS fresh installs with fresh Docker containers and fresh Node.js installations may experience a Corepack signature verification error during the pnpm installation process. This error occurs because Corepack fails to verify the digital signature for the default pnpm binary, leading to build failures.

Solution:
This pull request addresses the issue by explicitly preparing a known, stable pnpm version using the following command in our Dockerfile:

RUN corepack enable pnpm && corepack prepare [email protected] --activate && pnpm install --frozen-lockfile

This change ensures that the Docker build process uses a verified pnpm version, bypassing the signature verification error and ensuring consistent builds on fresh installations.

Testing:
• Built the Docker image on an M3 macOS system with a fresh install of Node.js.
• Verified that the image builds successfully without the Corepack error.
• Ran tests to ensure the application behavior remains consistent.

Additional Notes:
• The pnpm version (8.7.0) is explicitly set. Future updates may require revisiting this version.
• This fix is specific to environments that experience this issue, particularly on M3 macOS systems with new setups.

Please review the changes and let me know if any further modifications are needed.

…ication error on M3 macOS fresh installs

Some M3 macOS fresh installs with fresh Docker containers and fresh Node.js installations may experience a Corepack signature verification error during the pnpm installation process. This error occurs because Corepack fails to verify the digital signature for the default pnpm binary, leading to a build failure.

To address this issue, this commit explicitly prepares a known, stable pnpm version using:
  
  corepack prepare [email protected] --activate

This ensures that the Docker build process uses a PNPM version with a verified signature, thereby bypassing the error and improving consistency across new installations.
@MahaKoala
Copy link
Author

Catalyzed by Issue on device:

after attempting to execute dockerfile step.

=> ERROR [app-dev base 4/5] RUN corepack enable pnpm && pnpm install 1.0s

[app-dev base 4/5] RUN corepack enable pnpm && pnpm install:
0.786 /usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535
0.786 if (key == null || signature == null) throw new Error(Cannot find matching keyid: ${JSON.stringify({ signatures, keys })});
0.786 ^
0.786
0.786 Error: Cannot find matching keyid: {"signatures":[{"sig":"MEUCICK4bLF6Ywa/faC/4PIt094EbceYRe19bBHQW0rAS/dGAiEA8/ofAy07ETUbu+ca1PM4HDYqcHOjBlvgvdWvG0hy3as=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"[keydata]"}]}
0.786 at verifySignature (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535:47)
0.786 at fetchLatestStableVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21553:5)
0.786 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0.786 at async fetchLatestStableVersion2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21672:14)
0.786 at async Engine.getDefaultVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22292:23)
0.786 at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22390:47)
0.786 at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23096:5)
0.786
0.786 Node.js v20.18.0


failed to solve: process "/bin/sh -c corepack enable pnpm && pnpm install" did not complete successfully: exit code: 1

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.

1 participant