yarn icon indicating copy to clipboard operation
yarn copied to clipboard

`yarn publish [.tgz]` refuses to run without `--new-version` option

Open deecewan opened this issue 9 years ago • 6 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? When running yarn publish on a pre-built tarball, yarn refuses to continue without the following error:

error Use the "--new-version [version]" flag to create a new version.

If the current behavior is a bug, please provide the steps to reproduce.

  • create a project with a package.json
  • build a valid tarball of the project
  • run yarn publish <location-of-tarball>

What is the expected behavior?

If the tarball provided is valid, it should already have a package.json inside it. In my case, I am pre-building and compressing before I publish, so the package.json is already set to the correct version. I would imagine that people build a tarball are not expecting the contents of that tarball to be modified during the publish stage, and I don't see a reason that the version must be bumped unless the tarball is being modified to reflect the new version. I do not think that it should be enforced that a version needs to be bumped in this case. It should only required bumping if the --new-version option is used.

Please mention your node.js, yarn and operating system version.

macOS 10.12.2, yarn 0.18.1, node 7.3.0

deecewan avatar Jan 11 '17 04:01 deecewan

same here with a folder. yarn 0.18.1, 0.19, 0.19.1 osx 10.9.5 node 6.9.4

rabbitfr avatar Jan 24 '17 13:01 rabbitfr

ok

You must respect http://semver.org/ for versioning. 0.1 won't work for example.

rabbitfr avatar Jan 24 '17 14:01 rabbitfr

Related to #722 and #2445

ghost avatar Apr 28 '17 21:04 ghost

Over a year later and this is still a problem. 😭

jshbrntt avatar Jan 31 '18 15:01 jshbrntt

Over a year and six months later and this is still a problem. sob

zukelwa20 avatar Aug 15 '18 09:08 zukelwa20

#6399 should fix it

Fer0x avatar Sep 19 '18 12:09 Fer0x