Skip to content

SyntaxError: Invalid regular expression flags on Pi #232

Closed

Description

@djspacedevil

Hello,

I want to use the tool on my Pi 4 with Ubuntu. But I got the following error:

file:///usr/local/lib/node_modules/codeburn/node_modules/string-width/index.js:19
const zeroWidthClusterRegex = /^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v;
^

SyntaxError: Invalid regular expression flags
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:152:18)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:299:14)

Node.js v18.20.4

BR,

Activity

  1. ozymandiashh commented on May 7, 2026

    @ozymandiashh
    Collaborator

    Thanks for reporting this. I opened #256 to make this failure mode explicit.

    The underlying issue is that current CodeBurn releases are no longer compatible with Node 18. Some modern terminal dependencies parse syntax that Node 18 cannot load, so the process crashed with:

    SyntaxError: Invalid regular expression flags
    

    before CodeBurn could print a useful message.

    The PR adds a small launcher in front of the main CLI bundle. It checks the runtime before loading Ink/terminal dependencies and now prints an actionable upgrade message when Node is too old. The package and README now require Node >=22.13.0, which also lines up with the unflagged node:sqlite requirement used by Cursor/OpenCode/Goose providers.

    So on the Pi, the expected fix is to upgrade Node from v18.20.4 to Node 22.13.0+ (or a current 24/25 release). After #256 lands, running on Node 18 should fail clearly with the upgrade message instead of the dependency-level regex crash.

    Validation in the PR:

    • runtime guard unit tests for Node 18, 22.11, 22.12, 22.13, 23, and 24+
    • npm run build with verified tiny dist/cli.js launcher
    • full test suite passing: 40 files / 539 tests
  2. iamtoruk commented on May 12, 2026

    @iamtoruk
    Member

    Fix in #319. The CLI now starts through a tiny launcher that checks for Node >= 22.13.0 before loading the main bundle. On Node 18 you'll get:

    codeburn requires Node.js >= 22.13.0 (current: v18.20.4)
    Upgrade at https://nodejs.org/
    

    instead of the SyntaxError: Invalid regular expression flags crash.

    @djspacedevil you can test from main:

    git clone https://github.com/getagentseal/codeburn.git
    cd codeburn && npm install && npm run build
    node dist/cli.js --version
    

    The fix is in the next release. The underlying requirement hasn't changed -- codeburn needs Node 22.13+ for node:sqlite and modern dependencies -- but now you get a clear message about it.

  3. added a commit that references this issue on May 12, 2026
    38e41e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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