Generate projects with `engine-strict` by default
- Lingua principale
- TypeScript
- Stelle
- 27k
- Fork
- 11.8k
- Merge medio
- 14h 23m
- PR unite (30g)
- 162
Descrizione
### Command
new
### Description
It is quite easy to install a package incompatible with the current Node runtime. NPM only emits a warning by default which is easily overlooked. Once the package is installed, running it may result in unpredictable behavior, or might even work in the short term and then suddenly fail seemingly randomly in the future due to unrelated updates or changes to executed code paths which suddenly become incompatible with the currently installed Node version.
### Describe the solution you'd like
New projects should generate an `.npmrc` with `engine-strict=true` by default when using NPM as the package manager.
https://docs.npmjs.com/cli/v11/using-npm/config#engine-strict
This opts-in to a stricter environment which emits a hard error when installing a package incompatible with the current Node environment.
Yarn and pnpm already use the strict behavior by default, so this aligns with the broader direction of the package manager ecosystem.
Spin off from https://github.com/angular/angular-cli/issues/30547.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con il comando `new` e traccia le differenze tra i file di progetto generati in base al gestore di pacchetti, concentrandoti sull'output `.npmrc` richiesto. Conferma che i nuovi progetti che usano NPM generino `.npmrc` con `engine-strict=true`, mentre gli altri gestori di pacchetti rimangano invariati, e verifica il comportamento con i test di generazione pertinenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- node.js, typescript
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100