concurrently: Build failed when using concurently
Hello, I’m building my projects using concurently but recently my builds fail with this error
yarn run v1.22.19
$ concurrently --kill-others-on-fail "yarn build:app1" "yarn build:app2"
/node_modules/cliui/build/index.cjs:293
const wrap = require('wrap-ansi');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/wrap-ansi/index.js from /Users/claudiu.cojocaru/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/node_modules/cliui/build/index.cjs:293:14)
at Object.<anonymous> (/node_modules/yargs/build/index.cjs:1:60678)
at Object.<anonymous> (/node_modules/yargs/index.cjs:5:30)
at Object.<anonymous> (/node_modules/concurrently/dist/bin/concurrently.js:30:33) {
code: 'ERR_REQUIRE_ESM'
}
error Command failed with exit code 1.
I’m using “concurrently”: “^8.2.0”
Thank you
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 17 (3 by maintainers)
I created a gist at https://gist.github.com/NobbZ/df3b2c3491cbb2ae85bdfe88df8ffaa6 that should contain the required information. If anything is missing please ask and I will try to provide it.
Thanks @NobbZ for the reproduction. I managed to reproduce it without using nix.
There are some issues about this on yargs and cliui about this:
Seems like this issue is related to yarn <1.22.22. Once I upgraded yarn, the issue is fixed. https://github.com/yarnpkg/yarn/releases/tag/v1.22.22
I never committed that and reverted already to only tailwind.
I will try to reproduce later this evening and then provide what I get.
Yeap, but I reckon that the problem may lie in Nuxt
I got the exact same error. Looking at the lock file, it was supposed to use wrap-ansi@7 but it was using wrap-ansi@v8 even though the lock file was saying otherwise. I had to delete yarn.lock and node_modules and re-run yarn. It’s the only way I was able to fix it. Luckily my versions were not too out of date.
I don’t have rimraf as a direct dependency but it’s included in my yarn.lock as a packaged dependency. My project uses Nuxt and after reverting from the 3.6.x release back to 3.5.3 while also restoring the yarn.lock fixed the issue. I may dig in a bit more to see why the upgrade breaks by project but I may also just wait until the next Nuxt release and try my luck then…
I’m also facing the same issue but I don’t believe concurrently is the cause as @gustavohenke said. Locally my dev server fails to boot with concurrently being the top of the stack for the trace but when I try and build my project in Github actions it fails on
cypress. This all occurred last week when I updated a lot of packages so now I get to filter out which one. I’ll report back here on which package it was so maybe @cojoclaudiu has the same one and can rollback versions.