Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Have NodePackageInstallTask use project directory if no directory specified

Aperta
#21,680 8 commenti 0 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
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
angular, typescript
Ambito
cli, tooling

Direzione di ricerca

Individua NodePackageInstallTask e la gestione del percorso di package.json nel codice degli schematics di Angular CLI. Riproduci lo scenario externalSchematic ng-new, quindi verifica che i task new e add installino per impostazione predefinita dalla directory del progetto appena creato e che l’opzione di compatibilità richiesta preservi il comportamento esistente.

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

Descrizione

area: @angular-devkit/schematics feature feature: insufficient votes

🚀 Feature request

Command (mark with an x)
  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc
Description
A clear and concise description of the problem or missing capability...

NodePackageInstallTask is frequently used by add tasks such as ng-add in @angular/material. If a schematic like this is called from a custom ng-new schematic using externalSchematic the install fails because it is run from some non-project directory rather than from inside the newly created project directory.

Describe the solution you'd like
If you have a solution in mind, please describe it.

Since schematics knows the location of package.json it should by default run NodePackageInstallTask from that same directory rather than using the working directory.

This would unfortunately qualify as a "breaking" change so a configuration option might be necessary to allow for the "old" (current) behavior once this change is made.

Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?

The only work-around I've been able to do is essentially replicating the behaviors of third-party schematic "add" tasks within my custom schematic and then running install after the fact which is less than ideal.

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

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

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.