This demo repository shows how to enforce the engines
property in a package.json
file. See also
this StackOverflow answer.
In the package.json, we're requiring
Node >= 14. Because we have a local .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 results.