Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: yarn npm publish fails with "New versions must be valid semver" #5785

Closed
1 task
milesj opened this issue Oct 11, 2023 · 3 comments
Closed
1 task

[Bug]: yarn npm publish fails with "New versions must be valid semver" #5785

milesj opened this issue Oct 11, 2023 · 3 comments
Labels
bug Something isn't working waiting for feedback Will autoclose in a while unless more data are provided

Comments

@milesj
Copy link

milesj commented Oct 11, 2023

Self-service

  • I'd be willing to implement a fix

Describe the bug

When setting the version to 1.16.0-nightly.20231011+0324, which includes a preid and build metadata, yarn npm publish fails with "New versions must be valid semver.".

This is definitely valid semver.

To reproduce

{
  "name": "package",
  "version": "1.16.0-nightly.20231011+0324"
}

BTW, the sherlock link in the form does not work.

Environment

System:
    OS: macOS 13.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 20.8.0 - /private/var/folders/ml/41y5w4hx6fs1hqk57hd334y40000gn/T/xfs-b653288e/node
    Yarn: 3.6.3 - /private/var/folders/ml/41y5w4hx6fs1hqk57hd334y40000gn/T/xfs-b653288e/yarn
    npm: 9.6.2 - ~/.proto/bin/npm
    pnpm: 8.9.0 - ~/.proto/bin/pnpm
  npmPackages:
    jest: ^29.7.0 => 29.7.0

Additional context

I'm trying to setup a nightly release using this semver pattern. You can see it here: https://github.com/moonrepo/moon/actions/runs/6477449087/job/17588025765

Expand "Publish npm packages". Right now a failed publish doesn't fail the job.

@milesj milesj added the bug Something isn't working label Oct 11, 2023
@arcanis
Copy link
Member

arcanis commented Oct 11, 2023

I strongly suspect this error comes from the npm registry itself, as Yarn doesn't even include it anywhere in its bundle.

@arcanis arcanis added the waiting for feedback Will autoclose in a while unless more data are provided label Oct 11, 2023
@arcanis
Copy link
Member

arcanis commented Oct 11, 2023

In fact, that's even what your logs say; HTTP 400, ie server error:

➤ YN0035: New versions must be valid semver.
➤ YN0035:   Response Code: 400 (Bad Request)
➤ YN0035:   Request Method: PUT
➤ YN0035:   Request URL: https://registry.yarnpkg.com/@moonrepo%2fcli

@arcanis arcanis closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2023
@milesj
Copy link
Author

milesj commented Oct 11, 2023

🤔

Would be nice to know what about the version is actually invalid. I suppose I'll try another format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for feedback Will autoclose in a while unless more data are provided
Projects
None yet
Development

No branches or pull requests

2 participants