Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RRFC] allowing to use engines as config variable #769

Open
ThePlenkov opened this issue Apr 18, 2024 · 0 comments
Open

[RRFC] allowing to use engines as config variable #769

ThePlenkov opened this issue Apr 18, 2024 · 0 comments

Comments

@ThePlenkov
Copy link

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 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant