ITADN

create-next-app fails with pnpm v11+ due to build approval

#95170Closed2wndrhs 创建于 2026-06-25
create-next-appinvalid link
2
2wndrhscommented
### Link to the code that reproduces this issue This reproduces from a fresh directory by running create-next-app itself with pnpm v11+. ### To Reproduce ```bash node --version pnpm --version pnpm create next-app@latest repro-cna-pnpm-v11 --use-pnpm --yes ``` This reproduces with the default create-next-app template under pnpm v11+. ### Current vs. Expected behavior #### Current behavior: create-next-app starts creating the app, but the dependency installation aborts with: ```bash [ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: sharp@0.34.5, unrs-resolver@1.12.2 Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. Aborting installation. pnpm install has failed. ``` The generated pnpm-workspace.yaml contains unresolved pnpm v11+ approval placeholders: ```yaml allowBuilds: sharp: set this to true or false unrs-resolver: set this to true or false ignoredBuiltDependencies: - sharp - unrs-resolver ``` #### Expected behavior: create-next-app should generate pnpm configuration that works with pnpm v11+ without aborting the initial install. If the intent from #83168 is still to not run these unnecessary postinstall scripts, the generated config should use pnpm v11's allowBuilds form, for example: ```yaml allowBuilds: sharp: false unrs-resolver: false ``` ### Provide environment information ```bash Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 25.5.0 Binaries: Node: 24.16.0 pnpm: 11.4.0 Relevant Packages: create-next-app: 16.2.9 next: 16.2.9 react: 19.2.4 react-dom: 19.2.4 typescript: 5.9.3 Next.js Config: output: N/A ``` ### Which area(s) are affected? (Select all that apply) create-next-app ### Which stage(s) are affected? (Select all that apply) next dev (local), next build (local) ### Additional context This appears related to #83158 and #83168. #83168 added `ignoredBuiltDependencies` for `sharp` and `unrs-resolver`, which matched the pnpm v10-era behavior. With pnpm v11+, build approval is represented via allowBuilds, and create-next-app currently leaves unresolved placeholders in the generated pnpm-workspace.yaml. I also verified locally that replacing the generated config with: ```yaml allowBuilds: sharp: false unrs-resolver: false ``` allows pnpm install to complete, and the generated app can then pass lint/build.
关闭于 2026-06-25 1 条评论