I am trying to add the latest version of Cypress for E2E testing to my Nuxt 3 project. However, when I am trying to run npx cypress open
, the following error appears:
/myproject/node_modules/listr2/dist/renderer/default.renderer.js:7
const cliWrap = require("wrap-ansi");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /myproject/node_modules/wrap-ansi/index.js from /myproject/node_modules/listr2/dist/renderer/default.renderer.js not supported.
Instead change the require of index.js in /myproject/node_modules/listr2/dist/renderer/default.renderer.js to a dynamic import() which is available in all CommonJS modules.
Is there a way to bypass this requirement? I had a similar issue while adding Cypress via yard add, but I bypassed it by adding wrap-ansi of a lower version as a separate dependency.