Skip to content

Publish v4 to npm on a Node that npm supports, and build first - #215

Merged
paul-paliychuk merged 1 commit into
v4from
fix/v4-npm-publish-node-and-build
Aug 25, 2026
Merged

Publish v4 to npm on a Node that npm supports, and build first#215
paul-paliychuk merged 1 commit into
v4from
fix/v4-npm-publish-node-and-build

Conversation

@paul-paliychuk

Copy link
Copy Markdown
Contributor

The 4.0.0-alpha.1 publish failed with ENEEDAUTH — and would have published an empty package if it hadn't.

Auth: the trust config is fine, the runtime wasn't

Trusted publishing is configured for getzep/zep-jsnpm-publish-cloud.yml, and the job already requests id-token: write. The exchange never happened because npm refused to run:

npm warn cli npm v12.0.2 does not support Node.js v20.20.2.
This version of npm supports the following node versions:
`^22.22.2 || ^24.15.0 || >=26.0.0`
...
npm error code ENEEDAUTH

npx -y npm@latest now resolves npm 12; the job pinned Node 20. Node 24 lets OIDC run.

The tarball is the more serious half

npm notice 11.4kB LICENSE
npm notice 13.5kB README.md
npm notice 10.7kB package.json
npm notice 61.0kB reference.md
npm notice total files: 4

No dist/. v3's package.json carried "prepack": "yarn build", so npm publish built on its way out. The v4 generator emits no prepack, and files ships only dist — so main: ./dist/cjs/index.js pointed at something not in the tarball.

The auth failure is the only reason a broken package didn't reach npm under a version number that can never be reused. This builds explicitly instead of depending on a lifecycle script the generator no longer writes.

Unchanged

The prerelease branch still runs publish --tag preview. The release audit's two requirements on this file both still hold.

Follow-up for v3

main's workflow has the same node-version: '20' + npx -y npm@latest pairing. It published 3.28.0 only because npm@latest still supported Node 20 then — the next v3 release will fail identically. Worth fixing there too, and pinning npm rather than tracking @latest.

The 4.0.0-alpha.1 publish failed with ENEEDAUTH, and would have published an
empty package if it had not.

Trusted publishing is configured for this repository and workflow, and the
job already requests id-token: write. The credential exchange never happened
because the runtime is unsupported: npx -y npm@latest now resolves npm 12,
which requires Node ^22.22.2 || ^24.15.0 || >=26, and the job pinned Node 20.
npm said so directly before failing. Moving to Node 24 lets the OIDC exchange
run.

The tarball is the more serious half. v3's package.json carried
"prepack": "yarn build", so npm publish built on its way out. The v4
generator emits no prepack, and package.json ships only the dist directory,
so the tarball held four files -- LICENSE, README, reference.md and the
manifest -- with main pointing at a dist/ that was not in it. The auth
failure is the only reason that did not reach npm under a version number
that can never be reused. Builds explicitly rather than depending on a
lifecycle script the generator no longer writes.

The prerelease dist-tag branch is unchanged.

Note for v3: main's workflow has the same Node 20 and npx -y npm@latest
pairing. It published 3.28.0 only because npm@latest still supported Node 20
then; the next v3 release will fail the same way.
@paul-paliychuk
paul-paliychuk merged commit 8b63d71 into v4 Aug 25, 2026
3 checks passed
@paul-paliychuk
paul-paliychuk deleted the fix/v4-npm-publish-node-and-build branch August 25, 2026 01:25
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