I've been using yargs 15.4.1 for a CLI on Nodejs 14.8+ with ES Modules for some months. The index.js file is fairly simple:
import yargs from 'yargs';
import journal from './src/cli/journal';
import stats from './src/cli/stats';
yargs
.command(journal)
.command(stats)
.demandCommand()
.help()
.argv
;
After upgrading to 16.0.3, I get a TypeError:
file://~/Documents/Development/pourover-cli/index.js:12
.command(journal)
^
TypeError: yargs.command is not a function
at file://~/Documents/Development/pourover-cli/index.js:12:4
at ModuleJob.run (internal/modules/esm/module_job.js:146:23)
at async Loader.import (internal/modules/esm/loader.js:165:24)
at async Object.loadESM (internal/process/esm_loader.js:68:5)
Any thoughts? I suspect I'm missing an API change in v16?
I've been using yargs 15.4.1 for a CLI on Nodejs 14.8+ with ES Modules for some months. The index.js file is fairly simple:
After upgrading to 16.0.3, I get a
TypeError:file://~/Documents/Development/pourover-cli/index.js:12 .command(journal) ^ TypeError: yargs.command is not a function at file://~/Documents/Development/pourover-cli/index.js:12:4 at ModuleJob.run (internal/modules/esm/module_job.js:146:23) at async Loader.import (internal/modules/esm/loader.js:165:24) at async Object.loadESM (internal/process/esm_loader.js:68:5)Any thoughts? I suspect I'm missing an API change in v16?