Ephigenia / mite-cli

command line interface for time tracking service mite.yo.lk
MIT License
19 stars 8 forks source link

Unable to create new task/tracker with the interactive dialog. #260

Open kai-hier opened 3 months ago

kai-hier commented 3 months ago

Context

debian 12/bookworm mite mite 1.11.0 Node.js v18.19.0

Description

Unable to create new task/tracker with the interactive dialog.

Expected Behavior

When no arguments or just the "note" is given mite new asks for more details of the time-entry that should be created. Project, service and duration can be entered in an interactive survey.

Current Behavior

mite new
/usr/local/lib/node_modules/mite-cli/source/mite-new.js:5
const inquirer = require('inquirer');
                 ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/mite-cli/node_modules/inquirer/lib/inquirer.js from /usr/local/lib/node_modules/mite-cli/source/mite-new.js not supported.
Instead change the require of inquirer.js in /usr/local/lib/node_modules/mite-cli/source/mite-new.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/usr/local/lib/node_modules/mite-cli/source/mite-new.js:5:18) {
  code: 'ERR_REQUIRE_ESM'
}
Ephigenia commented 3 months ago

Got it. Thanks for catching this. I think this can be resolved by reverting inquirer to an earlier version or migrating everything to be ESM compatible which might require more effort.

kai-hier commented 2 months ago

Thanks for your fast reply. May you be able to show me how to downgrade inquirer?

Ephigenia commented 2 months ago

something like npm install inquirer@<previous-version>

kai-hier commented 3 weeks ago

Hello, is there anything new to this Problem?

I tried every version down to inquirer@8.0.0, but was unable to resolve the issue.