question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lerna --stream removing chalk colors log

See original GitHub issue

Expected Behavior

Chalk colors should be shown in the terminal. That’s the whole point of using chalk in the first place.

Screenshot 2019-08-31 at 17 53 24

Current Behavior

lerna run --stream command gives below kind of output. All the colors go away!! 😦

Screenshot 2019-08-31 at 17 49 35

Possible Solution

Please allow colors in lerna run --stream

Steps to Reproduce (for bugs)

  1. Run node filename_having_chalk_logs.js It’ll print proper chalk logs
  2. Now run the same command through lerna run <npm command> --stream, it won’t show the colors
lerna.json

<!-- Please paste your `lerna.json` here -->
{
  "packages": [
    "packages/**"
  ],
  "npmClient": "yarn",
  "useWorkspaces": true,
  "version": "independent"
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Context

I’m running a Koa server to proxy api requests coming from my react app to relay them to the backend servers, I’ve applied morgan logs for intercepting requests and spent lot of time in making the output colorful, but sadly all in vain cause of lerna. Please help.

Your Environment

Executable Version
lerna --version 3.15.0
npm --version 6.10.2
yarn --version 1.17.3
node --version 12.6.0
OS Version
macOS Mojave 10.14.6

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:23
  • Comments:9

github_iconTop GitHub Comments

34reactions
pi0commented, Apr 7, 2021

FORCE_COLOR=1 should also fix the problem for chalk 😃

12reactions
Akryumcommented, Oct 22, 2019

I made a package that supports colors: https://github.com/Akryum/monorepo-run 🐈

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lerna --stream removing chalk colors log - - Bountysource
Expected Behavior. Chalk colors should be shown in the terminal. That's the whole point of using chalk in the first place.
Read more >
Chalk, TypeScript and Lerna - DEV Community ‍ ‍
Next problem: color output is stripped when using Lerna. If you run lerna run doit --scope mypackage --stream all color output is stripped....
Read more >
Chalk, TypeScript and Lerna - Serge van den Oever's weblog
Next problem: color output is stripped when using Lerna. If you run lerna run doit --scope mypackage --stream all color output is stripped....
Read more >
@lerna/clean | Yarn - Package Manager
Change Log. All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
Read more >
Chalk NPM | npm.io
Compose multiple styles using the chainable API log(chalk.blue. ... instance configured with color support detected for stderr stream instead of stdout .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found