angular / angular/angular-cli

Generate projects with `engine-strict` by default

Ouverte
#31,271 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area: @schematics/angular feature
Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
14 h 23 min
PR mergées (30 j)
162

Description

### 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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la commande `new` et suivez les différences entre les fichiers de projet générés selon le gestionnaire de paquets, en vous concentrant sur la sortie `.npmrc` demandée. Confirmez que les nouveaux projets utilisant NPM génèrent un `.npmrc` avec `engine-strict=true`, tandis que les autres gestionnaires de paquets restent inchangés, et vérifiez le comportement avec les tests de génération concernés.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
node.js, typescript
Domaine
cli
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.