Chalk: TypeError: Cannot read property 'bold' of undefined => bgBlack?

Created on 11 Sep 2017  路  6Comments  路  Source: chalk/chalk

I swear bgBlack is available

but when I do this:

chalk.bgBlack.white.bold()

I get:

TypeError: Cannot read property 'bold' of undefined

Most helpful comment

@ORESoftware Cannot read property 'bold' of undefined means that chalk.bgBlack.white is undefined, NOT chalk.bgBlack is undefined.

You need to swear chalk.bgBlack.white is available. :)

All 6 comments

Hey there, I can't reproduce this.

> chalk.bgBlack.white.bold('hello')
'\u001b[40m\u001b[37m\u001b[1mhello\u001b[22m\u001b[39m\u001b[49m'

Which version of Chalk are you using?

Which npm version are you using? Make sure you're using the latest one, and then reinstall.

weird, thx, let me re-investigate, I should be on "chalk": "^1.1.3"...

since NPM v5 has been causing so much trouble, I have been sticking with v4.6.1.

@ORESoftware Cannot read property 'bold' of undefined means that chalk.bgBlack.white is undefined, NOT chalk.bgBlack is undefined.

You need to swear chalk.bgBlack.white is available. :)

@LitoMore thaz true

Closing as it's most likely an npm issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

macOneOone picture macOneOone  路  6Comments

juanmnl picture juanmnl  路  4Comments

roblg picture roblg  路  7Comments

mfour-merickson picture mfour-merickson  路  8Comments

sindresorhus picture sindresorhus  路  4Comments