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

Stdio is not inherited anymore in Lerna 5 #3214

Closed
BenoitZugmeyer opened this issue Jun 30, 2022 · 2 comments · Fixed by #3264
Closed

Stdio is not inherited anymore in Lerna 5 #3214

BenoitZugmeyer opened this issue Jun 30, 2022 · 2 comments · Fixed by #3264

Comments

@BenoitZugmeyer
Copy link
Contributor

BenoitZugmeyer commented Jun 30, 2022

Current Behavior

I am using a version npm script to open an editor and let the developer check and edit the CHANGELOG before a release. With Lerna 4, it worked flawlessly. Starting with 5.0.0, Lerna captures the standard input and output when running a npm lifecycle, so terminal editors like Vim don't show up anymore.

Expected Behavior

Restore the Lerna 4 behavior. When running a npm lifecycle, stdio should be inherited so the script can be interactive.

Steps to Reproduce

Minimal example to reproduce: lerna/repro#4

$ git clone https://github.com/BenoitZugmeyer/lerna-repro  
$ cd lerna-repro
$ npm i
$ npx lerna version --no-push --no-git-tag-version -y major                                                                                    
lerna notice cli v5.1.4
lerna info current version 0.0.0
lerna notice FYI git repository validation has been skipped, please ensure your version bumps are correct
lerna info Assuming all packages changed
lerna WARN version Skipping working tree validation, proceed at your own risk

Changes:
 - test: 0.0.0 => 1.0.0

lerna info auto-confirmed
lerna info execute Skipping git tag/commit
lerna info execute Skipping git push
lerna info execute Skipping releases
lerna info lifecycle lerna-repro@undefined~version: lerna-repro@undefined

> lerna-repro@undefined version /Users/benoit.zugmeyer/tmp/lerna-repro
> vim CHANGELOG.md

Then the script is stuck, vim does not show up.

Notes

If you run the same steps but install Lerna 4 instead, it works as expected.

Changing pipe to inherit here fixes the issue.

Failure Logs / Configuration

lerna.json

Nothing special:

{
  "packages": ["packages/*"],
  "version": "0.0.0"
}

Environment

 Environment info:

  System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.5.5 - ~/.volta/tools/image/node/16.15.0/bin/npm
  Utilities:
    Git: 2.36.1 - /opt/homebrew/bin/git
  npmPackages:
    lerna: ^5.1.4 => 5.1.4
@ghiscoding
Copy link

I think the latest PR #3262 will fix your issue

@JamesHenry
Copy link
Member

Thanks so much for the reproduction @BenoitZugmeyer!

#3262 won't fix this issue, as that only dealt with an issue I had observed on lerna publish (this repro deals with lerna version). I will work on a fix for this

BenoitZugmeyer added a commit to DataDog/browser-sdk that referenced this issue Jul 27, 2022
In particular, lerna v5.3 is fixing an issue I have when doing a `yarn
release`: lerna/lerna#3214
BenoitZugmeyer added a commit to DataDog/browser-sdk that referenced this issue Jul 27, 2022
In particular, lerna v5.3 is fixing an issue I have when doing a `yarn
release`: lerna/lerna#3214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants