`ensurePackageInstalled` kills the dev server on pnpm >= 10 even though the install succeeded (ERR_PNPM_IGNORED_BUILDS)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- developer-experience
Research direction
Start in src/utils/dependencies.ts at ensurePackageInstalled and inspect how addDependency errors are handled. Reproduce the installation through nuxt dev with pnpm >= 10 and no better-sqlite3 dependency. Done means a successful dependency addition with ERR_PNPM_IGNORED_BUILDS does not terminate the dev server.
Written by the indexing model from the issue text.
Description
Environment
- Operating System: Darwin (macOS 26.6.2, arm64)
- Node Version: v26.8.1
- Nuxt Version: 4.5.2
- Package Manager: pnpm@12.3.4
- Module:
@nuxt/content@3.16.0
Version
3.16.0
Reproduction
- Use pnpm >= 10 (build scripts are blocked by default).
- Start a Nuxt project with
@nuxt/contentand nobetter-sqlite3inpackage.json. - Run
nuxt devand answer Yes to the "Do you want to installbetter-sqlite3package?" prompt.
Description
ensurePackageInstalled calls addDependency without guarding against a non-zero exit from the package manager (src/utils/dependencies.ts):
await addDependency(pkg, {
cwd: tryUseNuxt()?.options.rootDir,
})
On pnpm >= 10, pnpm add better-sqlite3 succeeds at adding the dependency and then exits non-zero with ERR_PNPM_IGNORED_BUILDS, because pnpm refuses to run a package's build scripts until they are approved. nypm surfaces that exit code as a throw, and the whole dev server dies:
dependencies:
+ better-sqlite3 13.0.3
Error: ERR_PNPM_IGNORED_BUILDS
× adding a new package
╰─▶ Ignored build scripts: better-sqlite3@13.0.3
help: Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.
ERROR pnpm add better-sqlite3 failed.
at executeCommand (node_modules/.pnpm/nypm@0.6.9/node_modules/nypm/dist/index.mjs:79:28)
at async addDependency (node_modules/.pnpm/nypm@0.6.9/node_modules/nypm/dist/index.mjs:380:28)
at async ensurePackageInstalled (@nuxt/content/dist/module.mjs:230:5)
at async findBestSqliteAdapter (@nuxt/content/dist/module.mjs:414:3)
at async getDatabase (@nuxt/content/dist/module.mjs:302:17)
at async getLocalDatabase (@nuxt/content/dist/module.mjs:310:63)
at async processCollectionItems (@nuxt/content/dist/module.mjs:3347:14)
at async initNuxt (nuxt/dist/index.mjs:7811:2)
The install genuinely worked — my lockfile records better-sqlite3: specifier ^13.0.3, version 13.0.3 and package.json was updated. Simply re-running nuxt dev starts fine. The crash and stack trace are pure noise.
This is especially gratuitous on better-sqlite3 v13, which needs no build step at all. v13 dropped the install script entirely, sets "gypfile": false, and ships prebuilt binaries for all 8 platforms in prebuilds/. I confirmed the freshly installed, never-built copy works:
$ node -e "const D=require('better-sqlite3'); console.log(new D(':memory:').prepare('select sqlite_version() v').get())"
{ v: '3.53.4' }
So nuxt-content aborted the dev server over a build that (a) had already effectively succeeded and (b) was never needed in the first place.
Additional context
Related but distinct from #3329, which was about better-sqlite3 v11 genuinely failing to compile, and was closed as stale. This report is narrower: the install succeeds and the module works, yet nuxt-content still exits.
Separately, and not a nuxt-content bug: after pnpm approve-builds, pnpm ran node-gyp rebuild on better-sqlite3 13.0.3 despite it having no install script and declaring "gypfile": false. pnpm appears to trigger on the presence of binding.gyp in the tarball and ignore gypfile: false. That fails with node-gyp: command not found, but is harmless since the prebuilt binary is already in place. Noting it only because it appears in the same log and could confuse triage.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 746
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/content
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
defineGitSource Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Comark support Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100