pnpm add and pnpm install fail after ng new on pnpm 11+ (ERR_PNPM_IGNORED_BUILDS)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 27k
- Fork
- 11.8k
- Merge trung bình
- 1 ngày 34 phút
- Pull request đã merge (30 ngày)
- 275
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-serverCó thể đã có người làm @alan-agius4 đã nhận 4 ngày trước. Đang mởarea: @angular/build gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
angular/angular-cli#33955 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@angular/build: source-map comment scanner corrupts valid JS containing a regex literalCó thể đã có người làm @clydin đã nhận 1 ngày trước. Đang mởarea: @angular/build
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
angular/angular-cli#34590 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuildCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởarea: @angular/build
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
angular/angular-cli#34446 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: @angular/build
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
angular/angular-cli#34396 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Follow-up to issue: SSR: Add a way to configure externalDependencies for the server bundle onlyĐang mởarea: @angular/build
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
angular/angular-cli#34262 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của angular/angular-cli
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DSpace/dspace-angular#6511 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: frontend area:byok bug severity:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Phone app shows Unknown for a remote machine whose key changedCó thể đã có người làm @janicduplessis đã nhận hôm nay. Đang mởarea: mobile priority: P3 type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
appandflow/stim#5006 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area - Local to Cloud Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
microsoft/vscode-mssql#23209 ·
Maintainer thường phản hồi trong vòng 1 ngày