Skip to content

Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported. #159

@marikaner

Description

@marikaner

We use cliui transitively through jest, which is a CJS module. Currently, when running jest in our project, we get the following error:

Error [ERR_REQUIRE_ESM]: require() of ES Module [...]/node_modules/string-width/index.js from [...]/node_modules/cliui/build/index.cjs not supported.

I believe this is because of these lines.
Instead string-width and string-ansi, string-width-cjs' and string-ansi-cjsshould be required. Those are already installed. However, the third dependencywrap-ansi` does not exist as a CJS dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions