yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.41k stars 2.72k forks source link

yarn publish is bumping version on NPM Registry despite failing for multiple reasons. #6286

Open l3laze opened 6 years ago

l3laze commented 6 years ago

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

Report a bug

What is the current behavior? Yarn bumps the version on the NPM registry and attempts to publish when it should just be failing instead. I now have 3 versions "published" to NPM with IDK what contents if they're not in fact empty (bundlephobia says they're all the same size though), which are also missing commits except the last one as git was not even installed until then (and it's still apparently broken because git was not configured), and now I have to publish again to attempt to ensure the package isn't left in a broken state.

If the current behavior is a bug, please provide the steps to reproduce. Attempt to publish using yarn and fail to login properly. Attempt to publish using yarn while git has not been installed as a command line tool. Attempt to publish using yarn while git has not been configured either locally or globally with name & email.

What is the expected behavior? It should fail when required external command-line tools are not installed/configured, or when the user fails to login...

Please mention your node.js, yarn and operating system version. NodeJS v8.11.4 Yarn v1.9.4 NPM v5.6.0 (now updated to 6.4.0) Android v6.0.1 Termux v0.65 Git v2.18.0

shanimal commented 5 years ago

also should also not bump version if prepublishOnly returns an error code