Skip to content

Impossible to generate MFA with parse-dashboard --createMFA (parse dashboard 7.1.0) #2819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
n3me5is-git opened this issue May 21, 2025 · 4 comments
Open
4 tasks done
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@n3me5is-git
Copy link

New Issue Checklist

Issue Description

When running the command parse-dashboard --createMFA I obtain an error about inquirer package.
I'm using Node 22 and latest parse dashboard.

$ ./node_modules/parse-dashboard/bin/parse-dashboard --createMFA

/home/node/app/node_modules/parse-dashboard/Parse-Dashboard/CLI/mfa.js:211
    const { username, app } = await inquirer.prompt([
                                             ^

TypeError: inquirer.prompt is not a function
    at createMFA (/home/node/app/node_modules/parse-dashboard/Parse-Dashboard/CLI/mfa.js:211:46)
    at Command.<anonymous> (/home/node/app/node_modules/parse-dashboard/Parse-Dashboard/index.js:38:13)
    at Command.listener [as _actionHandler] (/home/node/app/node_modules/commander/lib/command.js:482:17)
    at /home/node/app/node_modules/commander/lib/command.js:1265:65
    at Command._chainOrCall (/home/node/app/node_modules/commander/lib/command.js:1159:12)
    at Command._parseCommand (/home/node/app/node_modules/commander/lib/command.js:1265:27)
    at Command.parseAsync (/home/node/app/node_modules/commander/lib/command.js:917:16)
    at run (/home/node/app/node_modules/parse-dashboard/Parse-Dashboard/index.js:45:17)
    at Object.<anonymous> (/home/node/app/node_modules/parse-dashboard/Parse-Dashboard/index.js:51:1)
    at Module._compile (node:internal/modules/cjs/loader:1730:14)

Steps to reproduce

Run the command

Actual Outcome

The error described

Expected Outcome

Working procedure to create MFA key

Environment

Current dependencies (Node 22):

$ npm ls inquirer
[email protected] /home/node/app
`-- [email protected]
  `-- [email protected]
Copy link

🚀 Thanks for opening this issue!

ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@n3me5is-git
Copy link
Author

For now i'm ovverriding it in the package.json

  "overrides": {
    "parse-dashboard": {
      "inquirer": "8.2.4"
    }
  },

Probably the fix is changing the way inquirer is imported.

@mtrezza
Copy link
Member

mtrezza commented May 24, 2025

Interesting find, would you want to try and open a PR, so we can see whether that fixes the issue?

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label May 24, 2025
@n3me5is-git
Copy link
Author

References: https://github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%409.0.0

Inquirer is now a native Node ECMAScript module. This will require your Node runtime to support es modules, and your app to be an es module. Node documentation over here: https://nodejs.org/api/esm.html#modules-ecmascript-modules

If you cannot migrate, please remember you can keep using the v8.x release line until you're ready.

I don't have time to test it, but the quicker fix is to lock the inquirer version (eg. "inquirer": "8.2.4") so when installing the dependencies the override won't be needed (tested working).

A possible fix (to be tested) could be also to try import the module using const inquirer = require('inquirer').default; in the Parse-Dashboard/CLI/mfa.js file.

Since inquirer is used only for CLI utils, not a core module, using an older version is not problem and the first proposal could be the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants