Questions tagged [chalk]
51 questions
1
vote
1 answer
How can I increase font size in Chalk for Node JS?
How can I increase font size in Chalk for Node JS? I wanted to do this with my code. This makes obviously the England flag but I want to add some text underneath saying it's coming home. Don't know looked on many gits and forums but couldn't find…

Nour Alaas
- 11
- 6
1
vote
3 answers
How to implement Chalk in Angular cli 6?
So I am building an Angular CLI 6 application and I wanted to implement the Chalk package to have some styling in my console logs.
For testing purposes, I've imported Chalk in my app.component.TS file as follows:
import { component } from…

Mirwais
- 131
- 1
- 4
- 18
0
votes
0 answers
Chalk pckg issues
C:\Users\DELL\AppData\Roaming\npm\node_modules\npm\lib\npm.js:4
const chalk = require('chalk')
^
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\DELL\AppData\Roaming\npm\node_modules\npm\node_modules\chalk\source\index.js from…
0
votes
1 answer
npm package chalk is not working with Cypress
I want to use https://www.npmjs.com/package/chalk for console logs.
Now if I use with console.log it works
console.log(chalk.blue("Hello World"))
but when I run it with cy.task it doesn't give any error but doesn't show any coloring
cy.task('log',…

paul
- 4,333
- 16
- 71
- 144
0
votes
0 answers
when I am using import chalk from chalk then yargs is not working
when i am using
const yargs = require('yargs')
then it is not working for chalk
and when i am using import chalk from chalk then it is working for chalk but showing error for yargs

Nitin Pandey
- 11
0
votes
1 answer
Why isn't my Node package being imported?
I'm learning Node.js and am using a Node-based Azure Function.
I'm trying to bring in Chalk, to log coloured messages to the console.
However, all of the below fail (in my main index.js file).
One
module.exports = async (ctx, req) => {
const…

user9540234
- 85
- 7
0
votes
2 answers
Chalk doesn't work on browser but runs on Node
I'm a newbie, I've been trying since this morning to get some code in order to run Chalk in the console of Firefox, Chrome and so forth.
I've seen tons of videos about modules and Babels and I've read here a lot of discussion, but nothing is still…

Romy
- 1
- 2
0
votes
1 answer
I have problem in changing the color in the console, I have imported nmp modules chalk but it is showing ESM require error. I don't understand
How to resolve the ESM require problem, I have tried a lot to resolve it but I was unable to fix this out.
0
votes
1 answer
NodeJS package outputting empty string
I'm trying to create my own NodeJS package that uses the chalk to output colored strings, but i'm getting empty string as output( when i run node test.js in terminal ) I tried searching online but couldn't find any reason for this. Does anyone have…

user13543812
- 3
- 3
0
votes
1 answer
Convert Require to Import
I am currently working on a Discord.js Bot in replit. The example code I found, which I used to get started with the bot, begins with this line of code.const { Client, Intents, Message } = require('discord.js'); const client = new Client( { intents:…

bmp
- 31
- 1
- 7
0
votes
2 answers
`chalk` library does not print colored text after bundle using webpack
I use chalk to write a simple script, and bundle the code using webpack.
The code print colored text before bundle, but print text without color after bundle
using webpack.
The test code is:
const chalk = require('chalk')
function main() {
…

dumeng
- 67
- 1
- 5
0
votes
1 answer
Issue using pychalk
When I run
import chalk
print(chalk.red("test"))
on visual studio code, I am able to get the red "test" output as follows: https://gyazo.com/73473a3fbaf58bbca524232d5952c325
but when i run the code from cmd, the color is no displayed:…

TTV jokzyz
- 349
- 1
- 3
- 13
0
votes
5 answers
Get random color inside forEach() in chalk.js
I am running a forEach() loop, and I need to console.log(). But I want to get a different color for each iteration. I went trhough docs, but couldn't find anything. Is there any way possible to achieve the same?
let arr = ["a", "ab,…

sujeet
- 3,480
- 3
- 28
- 60
0
votes
2 answers
gulp build fails with chalk version : 3.0.0
Got the below issue after the chalk version updated from 2.4.2 to 3.0.0. The gulp build fails resulting in production build failure.
--- frontend-maven-plugin:1.0:gulp (gulp build) @ vcedpa ---
[INFO] Running 'gulp.js build' in…

richa jha
- 13
- 1
- 2
0
votes
2 answers
Error with chalk module installing Vue-cli
Configuring VUE-CLI I am having the next problem:
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load…

inane
- 626
- 10
- 26