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
c8 tape 'test/**/*.js'
file:///Users/coderaiser/@cloudcmd/fileop/node_modules/yargs/yargs:3
const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')
^
ReferenceError: require is not defined in ES module scope, you can use import instead
at file:///Users/coderaiser/@cloudcmd/fileop/node_modules/yargs/yargs:3:69
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:534:37)
Can confirm this has broken a lot of builds. Basically anything that uses node@latest in CI with c8 (which at least shows using latest node did the intended job of catching these things 😄 ).
Edit: Was looking to make a PR to bump yargs in c8 itself, but bcoe already has one cooking: #578. So the 'fix' mentioned in this comment is only for the really impatient :-)
Activity
uhop commentedon Feb 25, 2026
The easiest way out of it is to update dependencies. Specifically go from
yargs17 to 18 — the major version has changed.43081j commentedon Feb 26, 2026
Can confirm this has broken a lot of builds. Basically anything that uses
node@latestin CI with c8 (which at least shows using latest node did the intended job of catching these things 😄 ).Work around bcoe/c8#582
Update dependencies, work around
update dependencies (#145)
build(npm): updates external dependencies
sverweij commentedon Feb 26, 2026
As a workaround I've temporarily added an override to our local package.json like so:
... and can confirm that, as @uhop mentions bumping yargs to 18 seems resolve the issue without code changes in c8 (build before override, build after override).
Patch c8 under Node.js 25
Downgrade c8
coderaiser commentedon Feb 27, 2026
Possible solution:
superc8with:parase-args#L176,check-coverage#L14);yargsthat works onnode v25andnode v26;execainstead offoreground-child;Patch c8 under Node.js 25
Engine, dependency and release updates
Merge pull request #957 from ain/dependabot/npm_and_yarn/c8-11.0.0
Temp revert "Update c8 to 11.0.0"
Don't use c8 for latest Node.js in CI
chore: override yargs version to fix c8 crash
override yargs version
YasharF commentedon May 5, 2026
Not working on Node v26 either
43081j commentedon May 13, 2026
@bcoe do you want any help with this? can open a PR if its of help. would be good to fix this
Temporarily work around yargs incompatibility with Node 26
Temporarily work around yargs incompatibility with Node 26
Temporarily work around yargs incompatibility with Node 26
Temporarily work around yargs incompatibility with Node 26
Temporarily work around yargs incompatibility with Node 26
YasharF commentedon Jul 22, 2026
I think this is fixed now in v12. @coderaiser can you verify and close this issue if it is fixed?
fix(ci): drop Node 26 from CI matrix due to c8/yargs incompatibility