Skip to content

Bad release?Β #1197

@lysein

Description

@lysein

🐞 Bug Description

Describe the bug
[email protected] alpha fails to install due to an ESM/CommonJS incompatibility. The CLI uses require("inquirer"), but inquirer is ESM-only, causing a hard crash (ERR_REQUIRE_ESM) during installation. This occurs even though the package declares node >= 20 as a required engine.


πŸ” Steps to Reproduce

  1. Install Node.js 18 or 20 (tested with both):

    nvm install 18
    nvm use 18
  2. Clear npm cache:

    rm -rf ~/.npm
    npm cache clean --force
  3. Run the installer:

    npx bmad-method@alpha install
  4. Confirm installation when prompted.


βœ… Expected Behavior

The installer should run successfully on a supported Node.js version, or at minimum fail gracefully with a clear message if the runtime is unsupported.


🧩 Environment Details (be specific)

  • BMad Method version: 6.0.0-alpha.21
  • Node.js version: v18.20.8 (also reproducible on v20.13.1)
  • Model(s) used: N/A
  • Agentic IDE used: N/A
  • Website used: N/A
  • Project language: JavaScript / Node.js

πŸ”§ Proposed Fix / PR

The installer is CommonJS but depends on ESM-only inquirer. Possible fixes:

  • Replace require("inquirer") with a dynamic import:

    const inquirer = (await import("inquirer")).default;

    (installer would need to be async), or

  • Pin inquirer to a CommonJS-compatible version (≀ v8), or

  • Convert the CLI to full ESM and update imports accordingly.

I’m happy to submit a PR once the preferred approach is confirmed.


πŸ“Ž Screenshots or Logs

Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/inquirer/lib/index.js
from .../installer.js not supported.
Instead change the require of index.js to a dynamic import()

Additional warnings:

npm WARN EBADENGINE required: { node: '>=20.0.0' }

πŸ“ Additional Context

  • The issue is not environment-specific and reproduces on clean macOS setups.
  • [email protected] installs correctly, suggesting the regression was introduced in the alpha branch.
  • The current alpha release appears to declare Node β‰₯ 20 while still relying on CommonJS patterns incompatible with ESM-only dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions