Skip to content

install fails on Node 26: shipped npm-shrinkwrap.json pins better-sqlite3@12.6.2 (fixed in 12.11.1) #1039

Description

@larsmoan

Summary

npm install -g @the-open-engine/zeroshot fails on Node 26. The published tarball includes an npm-shrinkwrap.json that pins better-sqlite3 to 12.6.2. That version has no v147 (Node 26 ABI) prebuild, and the source in 12.6.2 still uses v8::PropertyCallbackInfo<T>::This(), which V8 in Node 26 removed. So prebuild-install falls back to node-gyp rebuild, and the C++ compile fails.

The package.json range ^12.6.2 covers versions with the fix. But npm uses the shrinkwrap first, so the consumer gets 12.6.2.

Environment

  • OS: macOS (darwin 25.5.0, arm64)
  • Node: v26.2.0 (NODE_MODULE_VERSION 147, ABI v147)
  • npm: bundled with Node 26
  • zeroshot: 6.41.1
  • Node manager: fnm

Reproduction

fnm use 26
npm install -g @the-open-engine/zeroshot

Failure

node-gyp rebuild on better-sqlite3@12.6.2 gives:

../src/objects/statement.cpp:381:43: error: no member named 'This' in 'v8::PropertyCallbackInfo<v8::Value>'
../src/objects/database.cpp:411:50: error: no member named 'This' in 'v8::PropertyCallbackInfo<v8::Value>'
../src/objects/database.cpp:415:39: error: no member named 'This' in 'v8::PropertyCallbackInfo<v8::Value>'

Upstream fixes

Two upstream PRs matter:

Both fixes together are in better-sqlite3 >= 12.10.0. With 12.10.0+, a Node 26 (v147) prebuilt binary is on GitHub Releases for darwin-arm64, so no local compile happens.

Verified:

$ fnm use 26 && npm install better-sqlite3@12.11.1
added 38 packages in 3s

Root cause

The published tarball has an npm-shrinkwrap.json. npm uses this file for the consumer tree.

Read the tarball:

$ npm pack @the-open-engine/zeroshot@6.41.1
$ tar xzf the-open-engine-zeroshot-6.41.1.tgz
$ grep -A1 '"node_modules/better-sqlite3"' package/npm-shrinkwrap.json
    "node_modules/better-sqlite3": {
      "version": "12.6.2",

Install the package:

$ npm install @the-open-engine/zeroshot@6.41.1 --ignore-scripts
$ npm ls better-sqlite3
zeroshot-npmls@1.0.0
└─┬ @the-open-engine/zeroshot@6.41.1
  └── better-sqlite3@12.6.2

Without the shrinkwrap, ^12.6.2 would give a fixed version. The shrinkwrap blocks that.

Suggested fix

Do these steps:

  1. Set better-sqlite3 to ^12.10.0 (or higher) in package.json.
  2. Regenerate npm-shrinkwrap.json.
  3. Publish a new version.

No source code change is necessary.

You can also examine if a global CLI must ship npm-shrinkwrap.json. This file stops the consumer from getting fixed dependencies. This bug is one example. package-lock.json gives you a reproducible build but is not published. This is a policy choice.

Workaround

Install with Node 22 or 24 LTS:

fnm install 22 && fnm use 22
npm install -g @the-open-engine/zeroshot

References

Activity

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