You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Short version: Are you using yarn 1? Try upgrading to yarn v1.22.22 or higher.
Long version
The problem isn't actually in this repo. Or at least, not yet.
PR #139 uses package aliases to pull in two different versions of string-width et al to add wrapping support for esm. It is published as @isaacs/cliui from a cliui fork and is used as a dependency of JackSpeak. The aliases can trigger broken dependency resolution with Yarn 1.
With a closer look I realized the problem might not be this package because I got the same issue with another. I was in fact using yarn 1.22.19. Thanks for the tip!
mnvr
added a commit
to ente-io/ente
that referenced
this issue
May 1, 2024
We use cliui transitively through jest, which is a CJS module. Currently, when running
jest
in our project, we get the following error:I believe this is because of these lines.
Instead
string-width
andstring-ansi
,string-width-cjs' and
string-ansi-cjsshould be required. Those are already installed. However, the third dependency
wrap-ansi` does not exist as a CJS dependency.The text was updated successfully, but these errors were encountered: