Skip to content
ecdsa.com
npm publish --provenance (npm 9.5+)Package managers

Error message

Automatic provenance generation not supported for provider: null

Also printed as

  • Provenance generation in GitHub Actions requires "write" access to the "id-token" permission
  • Provenance generation in GitLab CI requires "SIGSTORE_ID_TOKEN" with "sigstore" audience to be present in "id_tokens".

In GitHub Actions without `permissions: id-token: write` the message is 'Provenance generation in GitHub Actions requires "write" access to the "id-token" permission' (both reproduced with npm 11.19.1); in GitLab without the `id_tokens` entry it names `SIGSTORE_ID_TOKEN` (text from libnpmpublish's source). All are `EUSAGE` errors. The provider name comes from npm's CI detection (`ci-info`).

npm publish --provenance (npm 9.5+) — libnpmpublish, code EUSAGE

What it means

`npm publish --provenance` creates a signed SLSA provenance statement that says which CI workflow built the package. npm can only do that inside a supported CI system that provides an OIDC identity (GitHub Actions on GitHub-hosted runners, GitLab CI on shared runners); the identity is what Sigstore puts into the signing certificate. `provider: null` means npm detected no CI at all — the command ran on a developer machine or in an unsupported CI. Nothing was published.

Why it happens

How to fix it

  1. 1.

    Publish from a GitHub Actions workflow

    Grant `id-token: write`, run on a GitHub-hosted runner and publish with `--provenance`. npm's trusted publishing (OIDC) can replace the npm token entirely.

    yaml
    name: release
    on: { release: { types: [published] } }
    permissions:
      contents: read
      id-token: write          # lets npm obtain the OIDC token Sigstore needs
    jobs:
      publish:
        runs-on: ubuntu-latest   # GitHub-hosted runner
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with: { node-version: 24, registry-url: "https://registry.npmjs.org" }
          - run: npm ci
          - run: npm publish --provenance --access public
            env: { NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" }
  2. 2.

    Or from GitLab CI

    Request an ID token with the `sigstore` audience under `id_tokens`; npm picks it up from `SIGSTORE_ID_TOKEN`.

    yaml
    publish:
      image: node:24
      id_tokens:
        SIGSTORE_ID_TOKEN:
          aud: sigstore
      script:
        - npm publish --provenance --access public

Related errors

Browse the full signature error database