Skip to content

[Bug]: Native SQLite binding missing when installed via pnpm/mise (aube) — lifecycle scripts blocked, and the error only suggests an npm fix #641

Backlog

Description

@fish2lab

Product or interface

CLI - interactive TUI

Version

@minimax-ai/code 0.8.1 (better-sqlite3 12.11.1), Node 26.13.1 (ABI 147)

Platform

macOS

OS version and architecture

macOS 27 arm64

Issue area

Startup / install / update

Steps to reproduce

  1. Install the CLI through mise's npm backend, which installs with its embedded aube package manager (pnpm-compatible, in-process):
    # ~/.config/mise/config.toml
    [tools]
    "npm:@minimax-ai/code" = "latest"
    mise install
  2. Run mcode.

aube, like pnpm 10+, does not run dependency lifecycle scripts unless the package is allowlisted (allowBuilds / onlyBuiltDependencies). So better-sqlite3's install script (prebuild-install || node-gyp rebuild) never runs and build/Release/better_sqlite3.node is never created. mcode's own postinstall (verify-native-install.mjs) is skipped too, so nothing catches this at install time.

Expected and actual behavior

Actual: mcode fails at startup with:

MCode could not load its native SQLite dependency.
If npm reported blocked install scripts, the installation needs explicit script approval.
Reinstall with the original installer. For npm installations, run:
  npm install --global @minimax-ai/code@0.8.1 --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3 --registry https://registry.npmjs.org/ --foreground-scripts

The suggested fix only covers npm. For mise/pnpm/aube users, running it creates a second, global npm copy instead of fixing the installed one.

Workaround that works: allowlist the build in mise and reinstall:

[tools."npm:@minimax-ai/code"]
version = "latest"
allow_builds = ["better-sqlite3"]

mise install -f npm:@minimax-ai/code. After that, the binding is fetched by prebuild-install and mcode starts normally. (pnpm users would use pnpm approve-builds -g / onlyBuiltDependencies.)

Suggestions

  • Error message / docs: detect or at least mention non-npm installers (pnpm, mise/aube, bun) and show the matching allowlist command. Add these to the installation docs.
  • Longer term: consider removing the install-script dependency entirely. One option is shipping the binding as per-platform optionalDependencies packages (the esbuild/swc pattern), which needs no lifecycle scripts. Another is node:sqlite, since the supported Node range (22.19+, 24–26) already has it. Either option would also avoid the problem that verify-native-install.mjs is skipped under the same policies.

Related: #173 (updater assumes npm when npm is managed by pnpm).

Activity

  1. added
    tui
    on Dec 3, 2026
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

    tui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions