https://github.com/blimmer/enforced-package-json-engines
https://github.com/blimmer/enforced-package-json-engines
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/blimmer/enforced-package-json-engines
- Owner: blimmer
- Created: 2021-08-04T14:27:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-04T14:36:28.000Z (almost 5 years ago)
- Last Synced: 2025-01-09T13:57:47.928Z (over 1 year ago)
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo - Enforced `package.json` engine versions
This demo repository shows how to enforce the `engines` property in a `package.json` file. See also
[this StackOverflow answer](https://stackoverflow.com/a/68653111/808678).
In the [package.json](https://github.com/blimmer/enforced-package-json-engines/blob/main/package.json), we're requiring
Node >= 14. Because we have a local [.npmrc](https://github.com/blimmer/enforced-package-json-engines/blob/main/.npmrc)
file with `engines-strict=true`, running `npm install` with any Node version earlier than 14 will cause an error:

You can see this configuration working by checking out the
[GitHub action](https://github.com/blimmer/enforced-package-json-engines/actions/workflows/npm-enforced-engines.yml)
results.
