Lerna version from version lifecycle polluting global lerna execution
See original GitHub issueExpected Behavior
lerna version
would automatically commit the changes or at least complete correctly.
Current Behavior
Running lerna version
does update the version
in the package.json
but then immediately complains about those changes are unstaged and exits.
lerna version
lerna notice cli v3.16.4
lerna info current version 1.1.3
lerna info Looking for changed packages since v1.0.3
? Select a new version (currently 1.1.3) Patch (1.1.4)
Changes:
- @me/packageA: 1.1.3 => 1.1.4
- @me/packageB: 1.1.3 => 1.1.4
? Are you sure you want to create these versions? Yes
lerna info execute Skipping releases
lerna info lifecycle root@1.1.3~version: root@1.1.3
> root@1.1.3 version /Users/iMightyJun/Projects/Mitosis
> lerna version
lerna notice cli v3.16.4
lerna info current version 1.1.4
lerna info Looking for changed packages since v1.0.3
lerna ERR! EUNCOMMIT Working tree has uncommitted changes, please commit or remove the following changes before continuing:
lerna ERR! EUNCOMMIT M lerna.json
lerna ERR! EUNCOMMIT M packages/packageA/package.json
lerna ERR! EUNCOMMIT M packages/packageB/package.json
lerna info lifecycle root@1.1.3~version: Failed to exec version script
lerna ERR! lifecycle "version" errored in "root", exiting 1
Possible Solution
lerna version
should recognize it made those package.json changes and either stage these commits automatically or exit gracefully.
Steps to Reproduce (for bugs)
- run
lerna version
- type yes
lerna.json
{
"version": "1.1.4",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"message": "chore(release): publish %s"
},
"version": {
"allowBranch": "master",
"message": "chore(release): %s"
},
"run": {
"npmClient": "yarn"
}
},
"packages": [
"packages/*"
]
}
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
v3.16.4 |
npm --version |
6.9.0 |
yarn --version |
1.17.0 |
node --version |
v10.16.0 |
| OS | Version | | macOS Mojave| 10.14.5 | | NAME | VERSION |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Lerna version from version lifecycle polluting global lerna ...
Expected Behavior. lerna version would automatically commit the changes or at least complete correctly. Current Behavior.
Read more >@lerna/version - npm
Prompts for a new version. Modifies package metadata to reflect new release, running appropriate lifecycle scripts in root and per-package.
Read more >Version and Publish - Lerna
Lerna can increment your package's versions as well as publish your packages to NPM, and it provides a variety of options to make...
Read more >@lerna/version | Yarn - Package Manager
0 (2022-12-26). Features. version: support custom command for git tag (#2760 (6eac92f); version: use npmClientArgs in npm install after lerna ...
Read more >Untitled
```sh $ npm install --global lerna ``` Next we'll create a new folder: ```sh ... The version is kept in the `lerna.json` file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re running
lerna version
with aversion
lifecycle in the root package.json. Don’t do that, and you’ll avoid this error.In general, you should not name the scripts that you call
lerna
commands from (in the root package.json) “publish” or “version”, as these are significant names in npm-land.I thought https://github.com/lerna/lerna/commit/089392d242b6326f4865f81a8083ea858ed4091b would have fixed this, but I guess I failed to account for folks who call
lerna
globally. PRs welcome.This issue just appeared on mac after reinstall lerna. Please, help)