const chalk=require('chalk');
import chalk from 'chalk';

export const sayHello = () => {
console.log(chalk('Hello, Green World!'));
};

but error

Test suite failed to run SyntaxError: /app/83662_c1c37efe-9764-49c9-be81-ca34116a9fbb/helper.js: Identifier 'chalk' has already been declared. (2:7)

  • Hello,
    you need to remove che initial 'const...' since you're already importing it after.

7 days later

The will be like this to make it run
import chalk from 'chalk';
export const sayHello = () => {
console.log(chalk.green('Hello, Green World!'));
};

    Ennyolar96

    result is:

    1. Function sayHello should use the function chalk.green() to change the color of the output

    2. Function sayHello should print a single message to the console

    3. Function sayHello should print the message 'Hello, Green World!' to the console

    Write a Reply...