-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
🐞 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
-
Install Node.js 18 or 20 (tested with both):
nvm install 18 nvm use 18
-
Clear npm cache:
rm -rf ~/.npm npm cache clean --force -
Run the installer:
npx bmad-method@alpha install
-
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 onv20.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
inquirerto 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.