CI: publish with npm instead of yarn to fix 404 on publish#338
Closed
yyc1217 wants to merge 1 commit into
Closed
Conversation
`yarn publish` (classic) does not read the NODE_AUTH_TOKEN from the .npmrc that actions/setup-node generates, so it publishes unauthenticated and npm responds with a 404 "Not found" even though the package exists. Switch the publish step to `npm publish`, which consumes that token correctly.
1 similar comment
Owner
Author
|
Closing in favor of #339, which solves the same publish failure more completely via npm trusted publishing (OIDC) — no token to expire and 2FA no longer applies to CI publishing. This token-based Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Publishing failed with:
Diagnosis
A 404 when publishing an existing public package means authentication never reached npm — npm returns 404 (not 401) for unauthenticated writes so it doesn't leak whether a package exists. Confirmed against the registry:
twzipcode-vueexists publicly (latest2.2.2).3.0.0is not yet published, so this was a real auth failure, not a duplicate-version rejection.The root cause:
yarn publish(classic) does not readNODE_AUTH_TOKENfrom the.npmrcthatactions/setup-nodegenerates (//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}). That.npmrcmechanism is designed fornpm. Soyarn publishran unauthenticated → 404.Fix
Switch the publish step from
yarn publishtonpm publish, which consumes the generated.npmrctoken correctly.prepublishOnlystill runs the full gate (lint + test + smoke + build) regardless of the client.Verification
npm pack --dry-runconfirms the publish tarball is correct:dist/+src/components+src/index.js(demo excluded, per thefileswhitelist).Note
The publish job runs on tag pushes (
refs/tags/*). After merging, push av3.0.0tag to release. Make sure thenpm_tokensecret is a current Automation token with publish rights.Generated by Claude Code