Skip to content

Fix #831 - Pinned npm version with corepack#832

Merged
faisalman merged 11 commits into
faisalman:masterfrom
oleksandr-danylchenko:#831-pin-npm-with-corepack
Jun 13, 2026
Merged

Fix #831 - Pinned npm version with corepack#832
faisalman merged 11 commits into
faisalman:masterfrom
oleksandr-danylchenko:#831-pin-npm-with-corepack

Conversation

@oleksandr-danylchenko

Copy link
Copy Markdown
Contributor

Prerequisites

Type of Change

Chore, fixes #831

Description

Please include a summary of the change (current behavior vs new behavior), which issue is fixed (you can also link to an open issue here), and why this change is necessary.

I pinned the packageManager version with the corepack use npm. Now all the contributions would adhere to the same npm version, avoiding potential package-lock.json conflicts.

Additionally, I adapted GH Actions to use the corepack-installed npm version instead of the one provided by the setup-node action. Unfortunately, there's still a "bug" in the GH runner that requires running the setup-node twice: actions/setup-node#531 (comment). But I referenced it in the comment for maintainers

Impact

It may require the contributors to accept the corepack install prompt once they run the npm i. But nothing "breaking" per se.

@oleksandr-danylchenko oleksandr-danylchenko changed the title #831 pin npm with corepack Fix #831 - Pinned npm version with corepack May 15, 2026
@oleksandr-danylchenko oleksandr-danylchenko force-pushed the #831-pin-npm-with-corepack branch from 01572fc to de6e56c Compare May 28, 2026 11:44
@oleksandr-danylchenko

oleksandr-danylchenko commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Hello, @faisalman 👋🏻

There seems to be an oversight in the packag-lock.json file. It still uses the 2.0.9 version instead of the new 2.0.10, introduced in 4121c59

"title": "UAParser.js",
"name": "ua-parser-js",
"version": "2.0.10",

"name": "ua-parser-js",
"version": "2.0.9",

In this PR, I ran npm install to align both. Could you please take a look?

@oleksandr-danylchenko oleksandr-danylchenko force-pushed the #831-pin-npm-with-corepack branch from 9030fdf to bacf655 Compare May 28, 2026 11:48
faisalman
faisalman previously approved these changes Jun 2, 2026
@oleksandr-danylchenko

Copy link
Copy Markdown
Contributor Author

Interesting...

Copilot says that:

The root cause is actually the packageManager field that this PR adds to package.json:

"packageManager": "npm@11.14.1+sha512.6a8a4d674..."

Here's the chain of events that causes the failure:

  1. packageManager field activates Corepack's integrity checking. When Corepack sees this field with a sha512 hash, it attempts to verify the pinned npm version against the npm registry's signing keys.

  2. npm registry rotated its signing keys. The new key ID (SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U) was introduced after Node.js 22.13.1 was released, so the version of Corepack bundled inside that Node.js release simply doesn't know about it.

  3. The result: Even the very first npm config get cache invocation fails because Corepack's shim intercepts it, tries to verify, and throws Cannot find matching keyid.

faisalman
faisalman previously approved these changes Jun 3, 2026
@oleksandr-danylchenko

This comment was marked as resolved.

Comment thread package.json
Comment on lines +309 to +312
"allowScripts": {
"fsevents@2.1.3": true,
"fsevents@2.3.2": true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allowScripts is a new feature of the NPM 11.16.0 release:


Install behaviour is unchanged. Scripts still run as they always have. The only Phase 1 user-visible change is one advisory block at the end of npm install listing packages whose install scripts haven't been reviewed via the new allowScripts field in package.json. A future release will turn that advisory into an actual block.

@oleksandr-danylchenko oleksandr-danylchenko force-pushed the #831-pin-npm-with-corepack branch from 74406b3 to fd46c7a Compare June 3, 2026 14:56
@oleksandr-danylchenko oleksandr-danylchenko force-pushed the #831-pin-npm-with-corepack branch from 0aa1c08 to c3804b8 Compare June 3, 2026 19:23
faisalman
faisalman previously approved these changes Jun 4, 2026
# Conflicts:
#	.github/workflows/ci-build-test.yml
@faisalman faisalman merged commit 51ea479 into faisalman:master Jun 13, 2026
7 checks passed
@oleksandr-danylchenko oleksandr-danylchenko deleted the #831-pin-npm-with-corepack branch June 13, 2026 19:01
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.

npm version isn't pinned using corepack, so the package-lock.json may differ for contributors

2 participants