Generate projects with `engine-strict` by default
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 11.8k
- Avg merge
- 14h 23m
- Merged PRs (30d)
- 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.
Contributor guide
Research direction
Start with the `new` command and trace how generated project files differ by package manager, focusing on the requested `.npmrc` output. Confirm that new projects using NPM generate `.npmrc` with `engine-strict=true`, while other package managers remain unchanged, and verify the behavior with the relevant generation tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100