Chalk: Chalk not working in GitLab runner terminal

Created on 24 Aug 2017  路  3Comments  路  Source: chalk/chalk

const str1 = 'str1';

console.log(str1, str1.length); // clean
const str2 = chalk.red('str2');
console.log(str2, str2.length); // chalk styled

console.log(str1, str1.length); // clean
const str3 = '\x1b[42mstr3\x1b[0m';
console.log(str3, str3.length); // my styled

console.log(str1, str1.length); // clean

process.exit(0);

The above code resutls in the below two results.

My local computer terminal (working):
screen shot 2017-08-24 at 14 44 01

GitLab runner (not working):
screen shot 2017-08-24 at 14 44 23

Most helpful comment

@CyberiumShadow Ah indeed you are correct, that link perfectly summed up what was wrong.

I fixed the issue adding this to my .gitlab-ci.yml if anyone else stumbles upon this:

variables:
    FORCE_COLOR: '1'

Thanks again!

All 3 comments

This seems more like a duplicate issue to #195
@Qix- can confirm I believe
@basickarl try using the environment variable FORCE_COLOR=1 and see if it works in GitLab Runners

@CyberiumShadow Ah indeed you are correct, that link perfectly summed up what was wrong.

I fixed the issue adding this to my .gitlab-ci.yml if anyone else stumbles upon this:

variables:
    FORCE_COLOR: '1'

Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sindresorhus picture sindresorhus  路  4Comments

macOneOone picture macOneOone  路  6Comments

Martodox picture Martodox  路  3Comments

langpavel picture langpavel  路  8Comments

HillTravis picture HillTravis  路  8Comments