Skip to content

[BUG] npm pkg fix (soft) conflicts with npm publish --provenance #9865

Description

@typed-sigterm

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

This is not just a request to bump a dependency for a CVE

  • This is not solely a request to bump a dependency for a CVE

Current Behavior

When publishing with provenance, if repository.url is like git+https://github.com/foo/bar.git, it will fail:

npm error 422 Unprocessable Entity - PUT https://registry.npmjs.org/unplugin-portless - Error verifying sigstore provenance bundle: Failed to validate repository information: package.json: "repository.url" is "git+http://github.com/typed-sigterm/unplugin-portless.git", expected to match "https://github.com/typed-sigterm/unplugin-portless" from provenance

It asks to use like https://github.com/foo/bar. But when I switched to that, it complains:

npm warn publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
npm warn publish errors corrected:
npm warn publish "repository.url" was normalized to "git+https://github.com/typed-sigterm/unplugin-portless.git"

Expected Behavior

There should be a totally correct format

Steps To Reproduce

As above

Environment

GitHub ubuntu-slim image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions