Skip to content

Fix import statement for Yargs module#581

Open
coderaiser wants to merge 1 commit intobcoe:mainfrom
coderaiser:patch-2
Open

Fix import statement for Yargs module#581
coderaiser wants to merge 1 commit intobcoe:mainfrom
coderaiser:patch-2

Conversation

@coderaiser
Copy link
Contributor

yargs is ESM, and this file is CommonJS, this is no longer works in node v25

> 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)

Checklist
  • npm test, tests passing
  • npm run test:snap (to update the snapshot)
  • tests and/or benchmarks are included
  • documentation is changed or added

`yargs` is ESM, and this file is CommonJS, this is no longer works in node v25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant