pnpm add and pnpm install fail after ng new on pnpm 11+ (ERR_PNPM_IGNORED_BUILDS)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- cli
Línea de trabajo
Start with the ng new path that runs the package-manager install with --ignore-scripts, then look at how the generated project files are written. The report proposes adding a pnpm-workspace.yaml with allowBuilds entries for @parcel/watcher, esbuild, lmdb and msgpackr-extract, but it leaves open whether that needs a pnpm version check. Done means a fresh ng new --package-manager pnpm followed by pnpm add succeeds on pnpm 11+ and older pnpm versions still work. The version-gating question should be settled with a maintainer before coding.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Command
new
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When I create a new project with ng new --package-manager pnpm on pnpm 11 or later, ng new itself works, but the next pnpm add fails. A fresh pnpm install (after a clone, or on CI) fails the same way.
@angular/build depends on esbuild, @parcel/watcher and lmdb (which brings in msgpackr-extract), and they all have install scripts. Since pnpm 11, strictDepBuilds is on by default, so pnpm fails the install unless each of them is approved or denied under allowBuilds in pnpm-workspace.yaml. ng new doesn't hit it because it installs with --ignore-scripts, so it only shows up afterwards.
I ran into this in my project: https://github.com/Blotch-Smart-Frames/AngularLynx/issues/188
I have worked around it in my own ng add schematic, but every pnpm user gets this from a plain ng new, so I think ng new should write the pnpm-workspace.yaml for pnpm projects.
Minimal Reproduction
npx @angular/[email protected] new repro --package-manager pnpm --defaults
cd repro
pnpm add date-fns
A fresh install fails too:
rm -rf node_modules
pnpm install
Exception or Error
Error: ERR_PNPM_IGNORED_BUILDS
× adding a new package
╰─▶ Ignored build scripts: @parcel/[email protected], [email protected],
[email protected], [email protected]
help: Run "pnpm approve-builds" to pick which dependencies should be allowed
to run scripts.
Your Environment
Angular CLI : 22.2.5
Angular : 22.2.4
Node.js : 24.22.0
Package Manager : pnpm 12.16.1
Operating System : darwin arm64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 22.2.5 │ ^22.2.5 │
│ @angular/cli │ 22.2.5 │ ^22.2.5 │
│ @angular/common │ 22.2.4 │ ^22.2.0 │
│ @angular/compiler │ 22.2.4 │ ^22.2.0 │
│ @angular/compiler-cli │ 22.2.4 │ ^22.2.0 │
│ @angular/core │ 22.2.4 │ ^22.2.0 │
│ @angular/forms │ 22.2.4 │ ^22.2.0 │
│ @angular/platform-browser │ 22.2.4 │ ^22.2.0 │
│ @angular/router │ 22.2.4 │ ^22.2.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 6.0.3 │ ~6.0.2 │
│ vitest │ 5.0.5 │ ^5.0.0 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
On pnpm 10 it's only a warning, so it works there.
Adding this pnpm-workspace.yaml to the new project fixes it. pnpm install, pnpm add and ng build all work after. It's the same as what this repo has in its own pnpm-workspace.yaml:
allowBuilds:
'@parcel/watcher': false
esbuild: false
lmdb: false
msgpackr-extract: false
One thing to watch out for: pnpm older than 10.26 doesn't read allowBuilds, and pnpm 9 and 10.0 fail on a pnpm-workspace.yaml that has no packages field. So it probably needs a pnpm version check.
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 1 d 34 min
- PR fusionados (30 d)
- 275
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-serverPosiblemente ocupada @alan-agius4 la tomó hace 4 días. Abiertoarea: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angular-cli#33955 ·
Los mantenedores suelen responder en 1 día
-
@angular/build: source-map comment scanner corrupts valid JS containing a regex literalPosiblemente ocupada @clydin la tomó hace 1 día. Abiertoarea: @angular/build
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
angular/angular-cli#34590 ·
Los mantenedores suelen responder en 1 día
-
Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuildQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoarea: @angular/build
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
angular/angular-cli#34446 ·
Los mantenedores suelen responder en 1 día
-
area: @angular/build
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
angular/angular-cli#34396 ·
Los mantenedores suelen responder en 1 día
-
Follow-up to issue: SSR: Add a way to configure externalDependencies for the server bundle onlyAbiertoarea: @angular/build
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
angular/angular-cli#34262 ·
Los mantenedores suelen responder en 1 día
Todos los issues de angular/angular-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Broken links in the docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
🔊 a11y
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
betagouv/mon-entreprise#4726 ·
Los mantenedores suelen responder en 9 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Deltares/fews-pi-requests#357 ·
Los mantenedores suelen responder en 1 día
-
bug confirmed js v6
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día