Repository navigation
Description
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
11.27.0
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
Run a package.json script (eg pnpm test or pnpm run local:prep) from within a sandbox, such as a docker container that mounts pnpm store as read only:
docker run -v /host/path/to/pnpm-store:/container/path/to/pnpm-store:ro etc...
And/or on an isolated network so long as pnpm thinks its state is dirty:
docker run --network my_isolated_bridge (or --network none)
Describe the Bug
All scripts in package.json script fail to run. Either with a failed network request or a failed attempt to modify read-only volume:
[ERR_SQLITE_ERROR] unable to open database file
[ERR_SQLITE_ERROR] unable to open database filepnpm: unable to open database file
at file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:103725:19
at sqliteRetry (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:103635:14)
at StoreIndex.openDatabase (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:103724:9)
at new StoreIndex (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:103709:14)
at createNewStoreController (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:186188:83)
at async installDeps (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:225444:17)
at async Object.handler5 (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:226549:3)
at async file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:329570:19
at async main4 (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:329538:30)
at async runPnpm (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:329836:5)
[ERROR] Command failed with exit code 1: pnpm install
pnpm: Command failed with exit code 1: pnpm install
at getFinalError (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:90362:14)
at makeError (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:92669:21)
at getSyncResult (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:94514:10)
at spawnSubprocessSync (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:94474:14)
at execaCoreSync (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:94404:23)
at callBoundExeca (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:96932:23)
at boundExeca (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:96909:49)
at sync2 (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:97064:14)
at runPnpmCli (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:277638:5)
at runDepsStatusCheck (file:///home/coder/.nvm/versions/node/v24.21.0/lib/node_modules/pnpm/dist/pnpm.mjs:278854:7)
Related CLI options to bypass are not passed along: [ERROR] Unknown options: 'frozen-store', 'offline', 'frozen-lockfile'
Expected Behavior
Personally, I think run should not make any checks of pnpm state. In a monorepo, if install is required before say running a test, quite often other actions are also required, like building workspace dependencies, so automatic and required install doesn't offer much benefit.
If run must touch pnpm state by default, perhaps add a CLI option to bypass it?: --skip-all-fuckery
Which Node.js version are you using?
v24.21.0
Which operating systems have you used?
- macOS
- Windows
- Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
Activity
altaywtf commentedon Sep 24, 2026
I could reproduce both failures in Docker on 11.28.0, and the network one on 12.7.0.
Setup: a project with
is-positive@1.0.0and ahelloscript, installed in anode:24-bookworm-slimcontainer withstoreDir: /store. Then I deletednode_modules/.pnpm-workspace-state-v1.jsonso the state was dirty, and ranpnpm run helloin a new container:-v store:/store:ro: 11.28.0 fails with[ERR_SQLITE_ERROR] unable to open database filefrom the automaticpnpm install, and the script doesn't run. 12.7.0 runs the script.--network none: the automatic install stops at "Verifying lockfile against supply-chain policies". 11.28.0 was still waiting after 200 s. 12.7.0 fails after about 140 s withERR_PNPM_RESOLVING_NPM_RESOLVER_NETWORK_ERRORforis-positive. The script doesn't run on either version, even though every package is already innode_modulesand the store.--network none.11.27.0 fails the same way.
Written by an agent (Claude Code, Opus 5.5).
ferbs commentedon Sep 24, 2026
Scripts in package.json are used for a wide range of purposes, not just publish/install activities and should not require network access.
Shuuren commentedon Sep 25, 2026
I'm working on a fix for this.
fix: run scripts when installed modules already match the lockfile
fix: run scripts when installed modules already match the lockfile
ferbs commentedon Sep 26, 2026
Disabling verifyDepsBeforeRun seems to work, at least for an isolated network. in 11.27.0. I think its default shouldn't be install though.
fix(run): run the script when the pre-run install fails