Skip to content

feat(@schematics/angular): enable npm engine-strict in new workspaces - #34473

Closed
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:feat/ng-new-engine-strict
Closed

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:feat/ng-new-engine-strict

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

npm only warns when a dependency's engines doesn't match the installed Node.js version, while Yarn and pnpm fail. Generate an .npmrc with engine-strict=true for new workspaces that use npm, so installs with an unsupported Node.js version fail instead of printing an easy-to-miss warning.

Closes #31271

npm only warns when a dependency's `engines` doesn't match the installed Node.js version, while
Yarn and pnpm fail. Generate an `.npmrc` with `engine-strict=true` for new workspaces that use npm,
so installs with an unsupported Node.js version fail instead of printing an easy-to-miss warning.

Closes angular#31271

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures the workspace schematic to generate an .npmrc file with engine-strict=true when npm is selected as the package manager. This ensures that npm strictly enforces engine version requirements, matching the default behavior of other package managers like yarn, pnpm, and bun. Corresponding unit tests have been added to verify this behavior. There are no review comments, and I have no feedback to provide.

@alan-agius4

Copy link
Copy Markdown
Collaborator

Thank you for your contribution, @MeAkib!

Following some internal discussion, we've decided not to move forward with generating an .npmrc file with engine-strict=true by default. In practice, this issue does not come up very frequently, and we would prefer to avoid adding an extra configuration file to newly generated workspaces.

Closing this PR along with #31271. Thanks again for the effort!

@MeAkib
MeAkib deleted the feat/ng-new-engine-strict branch October 27, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate projects with engine-strict by default

2 participants