You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package.json allows us to use engines where we can limit node version.
In CI/CD we often use the pattern when we clone some projects and try to run some tasks from it which requires npm install.
Let's say our pipeline also can accept some parameter such as node version but at the same time we want to enforce a certain rule, when node verrsion of that image should match some version condition.
Currently it is also possible to enforce node version check by use of engines parameter directly in our package.json ( or indirectly via dependent packages ). However let's say if we want to run npm install as it would have something like engines: { node: >20 } we need to set it manually or at least via npm pkg set engines.node which will modify package.json and it's not perfect for CI/CD procedures where upstream project ideally should stay not touched.
I thought if we would have an option to run something like:
npm_config_engines_node='>=18.8` npm i
which would enforce engine check as it's declared in package.json
then we could enforce engine from command line
What do you think of this?
Thanks!
The text was updated successfully, but these errors were encountered:
Motivation ("The Why")
package.json allows us to use engines where we can limit node version.
In CI/CD we often use the pattern when we clone some projects and try to run some tasks from it which requires npm install.
Let's say our pipeline also can accept some parameter such as node version but at the same time we want to enforce a certain rule, when node verrsion of that image should match some version condition.
Currently it is also possible to enforce node version check by use of engines parameter directly in our package.json ( or indirectly via dependent packages ). However let's say if we want to run
npm install
as it would have something likeengines: { node: >20 }
we need to set it manually or at least vianpm pkg set engines.node
which will modify package.json and it's not perfect for CI/CD procedures where upstream project ideally should stay not touched.I thought if we would have an option to run something like:
which would enforce engine check as it's declared in package.json
then we could enforce engine from command line
What do you think of this?
Thanks!
The text was updated successfully, but these errors were encountered: