Generate projects with `engine-strict` by default
- Ngôn ngữ chính
- TypeScript
- Star
- 27k
- Fork
- 11.8k
- Merge trung bình
- 14 giờ 23 phút
- Pull request đã merge (30 ngày)
- 162
Mô tả
### 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với lệnh `new` và lần theo cách các tệp dự án được tạo khác nhau theo từng trình quản lý gói, tập trung vào đầu ra `.npmrc` được yêu cầu. Xác nhận rằng các dự án mới sử dụng NPM tạo `.npmrc` với `engine-strict=true`, trong khi các trình quản lý gói khác vẫn không thay đổi, và xác minh hành vi này bằng các bài kiểm thử tạo tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100