Skip to content

ci: drop redundant 'npm install -g npm@latest' (fixes sigstore MODULE_NOT_FOUND on publish)#147

Merged
hhunaid merged 1 commit into
mainfrom
fix-npm-provenance-sigstore
Jul 10, 2026
Merged

ci: drop redundant 'npm install -g npm@latest' (fixes sigstore MODULE_NOT_FOUND on publish)#147
hhunaid merged 1 commit into
mainfrom
fix-npm-provenance-sigstore

Conversation

@hhunaid

@hhunaid hhunaid commented Jul 10, 2026

Copy link
Copy Markdown
Member

Problem

Follow-up to #146. With lts/* in place the EBADENGINE failure is gone (build now runs on Node 24.18.0), but the publish step now fails: run 29104808669.

npm error code MODULE_NOT_FOUND
npm error Cannot find module 'sigstore'
npm error - /opt/hostedtoolcache/node/24.18.0/x64/lib/node_modules/npm/node_modules/libnpmpublish/lib/provenance.js

Root cause

The Update npm for provenance support step runs npm install -g npm@latest, overwriting the toolcache's bundled npm. That npm-over-npm install lands a global npm whose sigstore dependency is missing, so npm publish --provenance blows up with MODULE_NOT_FOUND the moment it tries to generate the provenance attestation.

Fix

Delete the step. The npm bundled with a current LTS Node (npm 11.x on Node 24.18.0) already supports --provenance with sigstore intact, so publishing with the bundled npm just works. This also removes the last moving-version failure point in the workflow — nothing left to drift or self-corrupt.

Testing

  • npm cinpm run lintnpm run build pass locally.
  • The removed step had no effect on build output; it only touched the global npm used for publish.

Now that Node tracks latest LTS (24.x, bundling npm 11.x), this step is
not just unnecessary — it is actively breaking the publish. Installing
npm@latest over the toolcache npm produces a global install missing its
bundled 'sigstore' dependency, so 'npm publish --provenance' crashes:

  npm error code MODULE_NOT_FOUND
  npm error Cannot find module 'sigstore'

The npm bundled with a current LTS Node already supports provenance with
sigstore intact, so publishing with it directly works. Removing the step
fixes the publish and eliminates the last moving-version failure point.
@hhunaid hhunaid merged commit 4484c00 into main Jul 10, 2026
1 check passed
@hhunaid hhunaid deleted the fix-npm-provenance-sigstore branch July 10, 2026 15:51
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