Skip to content

[Bug] Installer Crash (v6 Beta 7) - "ReferenceError: require is not defined" in GDS/CIS module installers (Node 22) #4

@AlphaPerseii3000

Description

@AlphaPerseii3000

Description

I am attempting to install the gds (Game Dev Suite) module using the BMAD Method CLI v6.0.0-Beta.7. The installation fails specifically during the Running gds module installer... step with a ReferenceError: require is not defined.

I initially encountered this with the cis module, removed it, and now I am facing the exact same error with gds.

Steps to Reproduce

Run npx bmad-method install in a Windows environment.

Select Modify BMAD Installation.

Select BMad Game Dev Suite (and deselect others to isolate).

Proceed with installation.

The core installation works, dependencies install, but the process crashes when running the module-specific installer script.

Error Log

text
⠹ Running gds module installer...Error running module installer for gds: require is not defined
✔ Module-specific installers completed
⠋ Restoring 17 custom files...file:///C:/Users/PlayerOne/.bmad/cache/external-modules/gds/src/_module-installer/installer.js:1
const fs = require('fs-extra');
^

ReferenceError: require is not defined
at file:///C:/Users/PlayerOne/.bmad/cache/external-modules/gds/src/_module-installer/installer.js:1:12
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:395:35)
...

Environment

OS: Windows (running via Google Antigravity IDE)

Node Version: v22.12.0

BMAD CLI Version: v6.0.0-Beta.7

Modules Affected: gds, cis

Analysis

It appears the installer script located at .bmad/cache/external-modules/gds/src/_module-installer/installer.js is using CommonJS syntax (const fs = require('fs-extra')) but is being executed in an ESM context by Node 22.

Expected Behavior

The module-specific installer should execute successfully using either compatible ESM syntax (import) or by defining require via createRequire.

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