Skip to content

pnpm 11 cannot install dependencies because node:sqlite DatabaseSync methods are missing #2150

Description

@karlhorky

Companion StackBlitz issue to pnpm issues pnpm/pnpm#14018

Describe the bug

pnpm 11 cannot install dependencies in StackBlitz WebContainers because the WebContainers implementation of node:sqlite is missing DatabaseSync methods required by pnpm, including exec().

pnpm 11 replaced the JSON-per-package store index with a SQLite database in Apr 2026:

Link to the blitz that caused the error

https://stackblitz.com/edit/github-fuwsaec6?file=pnpm-workspace.yaml

Steps to reproduce

  1. Visit the reproduction URL above
  2. Install pnpm 11 using the StackBlitz workarounds detailed in issue #2149 and observe that pnpm 11 can now print its version
    ~/projects/github-fuwsaec6
    ❯ npm install --global --prefix "$HOME/.local" pnpm@11
    
    added 1 package in 3s
    
    1 package is looking for funding
      run `npm fund` for details
    
    ~/projects/github-fuwsaec6
    ❯ mkdir -p "$HOME/.config/pnpm"
    
    ~/projects/github-fuwsaec6
    ❯ touch "$HOME/.config/pnpm/config.yaml"
    
    ~/projects/github-fuwsaec6
    ❯ "$HOME/.local/bin/pnpm" --version
    11.22.0
  3. Attempt to install dependencies, and observe that pnpm fails in its SQLite-backed store because DatabaseSync.exec() is missing 💥
    ~/projects/github-fuwsaec6
    ❯ "$HOME/.local/bin/pnpm" install
    [ERROR] this.db.exec is not a function
    
    pnpm: this.db.exec is not a function
        at StoreIndex.openDatabase (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:102459:17)
        at new StoreIndex (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:102445:14)
        at createNewStoreController (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:182750:83)
        at async installDeps (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:219799:17)
        at async Object.handler5 (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:220906:3)
        at async eval (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:322605:19)
        at async main4 (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:322573:30)
        at async runPnpm (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:322869:5)
        at async eval (file:///home/.local/lib/node_modules/pnpm/dist/pnpm.mjs:322862:3)
  4. Inspect the WebContainers node:sqlite implementation and observe that DatabaseSync.exec() and the other expected prototype methods are missing 💥
    ~/projects/github-fuwsaec6
    ❯ node --input-type=module --eval "import * as sqlite from 'node:sqlite'; console.log(Object.keys(sqlite)); const db = new sqlite.DatabaseSync(':memory:'); console.log({ exec: typeof db.exec, methods: Object.getOwnPropertyNames(Object.getPrototypeOf(db)).sort() })"
    [ 'DatabaseSync', 'StatementSync', 'backup', 'constants', 'default' ]
    { exec: 'undefined', methods: [ 'constructor' ] }
    (node:18) ExperimentalWarning: SQLite is an experimental feature and might change at any time
    (Use `node --trace-warnings ...` to show where the warning was created)

Expected behavior

pnpm 11 installs dependencies successfully in StackBlitz WebContainers

More generally, WebContainers should support the node:sqlite DatabaseSync methods available in Node.js 22 that pnpm 11 relies on, including exec().

Parity with Local

Screenshots

No response

Platform

  • OS: macOS Tahoe 26.5.2 (25F84)
  • Browser: Chrome
  • Version: 151.0.7922.138 (macOS)

Additional context

Related issues:

cc @SamVerschueren if this should be reported some other way or in stackblitz/core, let me know

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