Chalk: Does not print on ForeverJS

Created on 15 Sep 2016  路  6Comments  路  Source: chalk/chalk

Hello Friend, I was programming using forever js as package for auto restart the service and it doesn't work with that package only if i'm using only node. Does anyone can help me how can i fix this bug...

Most helpful comment

Thanks for your hint, @Qix! For everyone coming here via Google...

Instead of this:

"scripts": {
  "start": "forever --minUptime 1000 --spinSleepTime 1000 src/index.js",
}

Do this:

"scripts": {
  "start": "cross-env FORCE_COLOR=1 forever --minUptime 1000 --spinSleepTime 1000 src/index.js",
},
"dependencies": {
  "forever": "0.15.3",
  "cross-env": "5.1.1"
}

All 6 comments

Have some code for us? This is impossible to debug as it is vague. How are you using chalk?

Yes i'm using chalk and here is a printscreen from my desktop and hoping you fix this issue.
Captura de ecra虄 2016-09-15, a虁s 22.07.16.png

  • Which platform? Which version?
  • Which terminal?
  • What does echo $TERM say?
  • What does echo $SHELL say?
  • What does npm i -g supports-color-cli; supports-color; echo $? say?
  • What command line are you using to run the program?
  • What does FORCE_COLOR=1 <your program command line> | cat -v say?

I almost guarantee you this is user error. :)


Side note, @sindresorhus we need a contributing.md file with these kinds of things in it, including an FAQ.

Hello Friend.
Again, it does support color client and i'm using iterm and as platform i'm with MacOs El Capitan 10.11.6. They only problem here is when i'm running any script with foreverjs and the output of it does not print with any color. Do you at least have tried you with any package beside using node as command?

Try to install forever js and print that out the output with color and give me any feedback.

Oh, foreverjs. That's because foreverjs is piping the output into itself and then to the TTY that owns foreverjs.

Use the environment variable FORCE_COLOR=1.

Thanks for your hint, @Qix! For everyone coming here via Google...

Instead of this:

"scripts": {
  "start": "forever --minUptime 1000 --spinSleepTime 1000 src/index.js",
}

Do this:

"scripts": {
  "start": "cross-env FORCE_COLOR=1 forever --minUptime 1000 --spinSleepTime 1000 src/index.js",
},
"dependencies": {
  "forever": "0.15.3",
  "cross-env": "5.1.1"
}
Was this page helpful?
0 / 5 - 0 ratings