v21.2.2 seems to be unable to handle npm workspaces

Đang mở
#32,787 7 bình luận 23 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue nà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
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
angular, node.js, typescript
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Bắt đầu với bản tái hiện tối thiểu được liên kết và chạy cd apps/test-app 6ff ng update @angular/core@21 bằng Angular CLI 21.2.2 trong một repository npm-workspaces. So sánh kết quả với cùng bản cập nhật trên v20 hoặc không có workspaces; hoàn tất khi các gói Angular được nhận diện là các dependency và quá trình cập nhật tiếp tục mà không có lỗi được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: @angular/cli freq1: low gemini-triaged ng update DX severity5: regression type: bug/fix
Command

update

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

v20

Description

While using npm workspaces, ng update @angular/core@21 (or any other angular package) with installed version @angular/cli@21 fails with the following error:

Using package manager: npm
Collecting installed dependencies...
Found 1 dependencies.
Package '@angular/core' is not a dependency.

This does not happen in the same repo with v20 installed (and trying to update to v20). It also does not happen in a repo without npm workspaces.

Minimal Reproduction

See https://github.com/jsangmeister/angular-cli-repro

I created the repo as follows:

npm init
mkdir apps
cd apps
ng new test-app

and then moving some files to the top level, e.g., the git folder.

When running cd apps/test-app && ng update @angular/core@21, the error appears.

Exception or Error
Package '@angular/core' is not a dependency.
Your Environment
_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI       : 21.2.2
Angular           : 21.2.4
Node.js           : 24.10.0
Package Manager   : npm 11.9.0
Operating System  : linux x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.2.2            │ ^21.2.2           │
│ @angular/cli              │ 21.2.2            │ ^21.2.2           │
│ @angular/common           │ 21.2.4            │ ^21.2.0           │
│ @angular/compiler         │ 21.2.4            │ ^21.2.0           │
│ @angular/compiler-cli     │ 21.2.4            │ ^21.2.0           │
│ @angular/core             │ 21.2.4            │ ^21.2.0           │
│ @angular/forms            │ 21.2.4            │ ^21.2.0           │
│ @angular/platform-browser │ 21.2.4            │ ^21.2.0           │
│ @angular/router           │ 21.2.4            │ ^21.2.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.1.0             │ ^4.0.8            │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?

No response

Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
16 giờ 21 phút
Pull request đã merge (30 ngày)
170

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/angular-cli

Tất cả issue của angular/angular-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.