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

Invalid version number when publishing as canary for the first time #1614

Closed
spoldman opened this issue Aug 28, 2018 · 4 comments
Closed

Invalid version number when publishing as canary for the first time #1614

spoldman opened this issue Aug 28, 2018 · 4 comments

Comments

@spoldman
Copy link

spoldman commented Aug 28, 2018

I'm trying to create a new package in my repository but when I try to publish a canary/next version I get an invalid version. "ERR! Invalid version: "null-alpha.NaN+ab983f0"". I might be doing something wrong as I'm using @lerna/publish directly in code. Also it is worth mentioning that I'm using independent versioning and this package has not been published before.

Expected Behavior

Version number for the new package should be something like: 1.0.0-alpha.next+ab983f0

lerna.json

{
  "packages": [
    "packages/*"
  ],
  "version": "independent",
  "npmClient": "yarn",
  "useWorkspaces": true
}

Context

import publish from '@lerna/publish'

....
await publish({
  canary: true,
  npmTag: 'next',
  yes: true,
  amend: true,
  verifyRegistry: false,
  verifyAccess: false,
})
...

The repository was created with lerna v2 but we are working on updating and changing a lot of other stuff

Your Environment

Executable Version
lerna --version 3.1.4
yarn --version 1.9.4
node --version 8.11.4
@evocateur
Copy link
Member

  • amend has no use here, as amending a git commit that doesn't exist doesn't make sense (canary never commits).
  • The npmTag does not affect the generated canary version string, that's preid.
  • A null version means the package.json is lacking a version field?

Or, as it turns out, a tag that it was not able to locate. Such as when an independently-versioned package has not been previously published. So that's definitely a bug.

@evocateur evocateur added the bug label Aug 28, 2018
@spoldman
Copy link
Author

spoldman commented Aug 28, 2018

I was just expirimenting with the options so maybe some of them do not make sense as you described. Thanks for all the info regarding the options.

To answeryour question, package.json has version: 1.0.0

@evocateur
Copy link
Member

Ah, yes, that makes sense. I think I have a fix, validating it right now...

@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants