npm trusted publishing breaks silently on versions older than 11.15.0
Developers setting up trusted publishing for npm packages may encounter a cryptic 400 Bad Request error with no explanation in CLI output or debug logs. The root cause is that npm versions 11.14.1 and older send a payload missing a required permissions field, after the registry began mandating at least one allowed action from 20 May 2026 onward. npm 11.15.0 and newer correctly catch the error client-side and prompt users to add the --allow-publish or --allow-stage-publish flag. Developers unable to upgrade Node to meet npm 12 requirements can work around the issue by running a compatible newer version via npx without a global install. Additionally, unlike PyPI, npm requires a package to already exist before trusted publishing can be configured, meaning the first release must always be published manually.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in