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.

Error Chalk has no method 'grey' after update

See original GitHub issue

After chalk was updated last night with version 1.1.3, I started having troubles with fancy-log, as npm is requiring this version:

├─┬ fancy-log@1.2.0 
│ ├─┬ chalk@1.1.3 
│ │ ├── escape-string-regexp@1.0.5 
│ │ └─┬ strip-ansi@3.0.1 
│ │   └── ansi-regex@2.0.0 

The error output shows the following:

/node_modules/fancy-log/index.js:9
return '['+chalk.grey(timestamp('HH:mm:ss'))+']';
                    ^

TypeError: Object #<Chalk> has no method 'grey'
at getTimestamp (node_modules/fancy-log/index.js:9:20)
at log (node_modules/fancy-log/index.js:13:14)
at module.exports (node_modules/gulp-util/lib/log.js:11:14)
at Object.module.exports.logError (node_modules/gulp-notify/lib/extra_api.js:20:3)
at logError (node_modules/gulp-notify/lib/notify.js:91:11)
at node_modules/gulp-notify/lib/notify.js:63:7
at module.exports (node_modules/gulp-notify/lib/report.js:37:12)
at DestroyableTransform._flush (node_modules/gulp-notify/lib/notify.js:62:5)
at DestroyableTransform.<anonymous> (node_modules/gulp-notify/node_modules/readable-stream/lib/_stream_transform.js:135:12)
at DestroyableTransform.g (events.js:180:16)
Process exited with code 8 

The line where the error is reported is really straightforward:

var chalk = require('chalk');
var timestamp = require('time-stamp');

function getTimestamp(){
  return '['+chalk.grey(timestamp('HH:mm:ss'))+']';
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Qix-commented, Mar 29, 2016

Strange. Ill take a look soon (I’m on the road at the moment).

As a temporary workaround you can do chalk.grey = chalk.gray. That should fix it.

0reactions
Qix-commented, Mar 30, 2016

No problem! Glad it was resolved 👯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chalk - npm
Specifies the level of color support. Color support is automatically detected, but you can override it by setting the level property. You should ......
Read more >
chalk - Error [ERR_REQUIRE_ESM]: require() of ES Module
If you want to use Chalk with TypeScript or a build tool, ... async function main(){ console.log((await chalk()).gray(">", ...commands)); }.
Read more >
How to use the chalk.dim function in chalk - Snyk
To help you get started, we've selected a few chalk.dim examples, based on popular ways it is used in public projects.
Read more >
How to: Use Chalk Paint® On Kitchen Cabinets - Annie Sloan
Step by step guide to painting kitchen cupboards with Chalk Paint®. First, remove the doors and any hardware from your cabinets. Give them...
Read more >
Remove Quilting Lines Left By Chalk Markers
Is there a safe way to remove the chalk marks as soon as I complete a block so the chalk is not sitting...
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