v21.2.2 seems to be unable to handle npm workspaces

Aperta
#32,787 7 commenti 23 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
angular, node.js, typescript
Ambito
cli, tooling

Direzione di ricerca

Inizia dalla riproduzione minima collegata ed esegui cd apps/test-app 6ff ng update @angular/core@21 usando Angular CLI 21.2.2 in un repository npm-workspaces. Confronta il risultato con lo stesso aggiornamento con v20 o senza workspaces; il lavoro è completato quando i pacchetti Angular vengono riconosciuti come dipendenze e l’aggiornamento procede senza l’errore segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
27k
Fork
11.8k
Merge medio
16h 21m
PR unite (30g)
170

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/angular-cli

Tutte le issue di angular/angular-cli

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.