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

[BUG] engine-strict does not work #786

Closed
jnardone opened this issue Feb 8, 2020 · 6 comments
Closed

[BUG] engine-strict does not work #786

jnardone opened this issue Feb 8, 2020 · 6 comments
Labels
Bug thing that needs fixing

Comments

@jnardone
Copy link

jnardone commented Feb 8, 2020

The NPM CLI option "engine-strict" (not to be confused with the engineStrict package.json, which is deprecated) does not work. It does not error out when set to true.

I'm 99% sure it's due to this

npm/npm-install-checks#10

which, as part of deprecating engineStrict completely removed the option to check strictly at all,

NPM CLI still passes the flag to this routine expecting it to respect the flag:

checkEngine(pkg, npm.version, nodeVersion, force, strict, iferr(next, thenWarnEngineIssues))

So, I'd say

  • either have the dependency fix their bug
    or
  • move strict enforcement check into the NPM CLI
    or
  • deprecate this option in the NPM CLI (boo, i think there's a use case here)
@ljharb
Copy link
Contributor

ljharb commented Feb 8, 2020

you can use npx ls-engines if you want a few features in one related to this use case.

@jnardone
Copy link
Author

Except nobody does this, people run "npm install"

@leandro-manifesto
Copy link

So, NPM 7 is now out with no signs of this being fixed.

I can't enforce its usage on projects if the feature that does the enforcing doesn't work.

@adam-thomas-privitar
Copy link

adam-thomas-privitar commented Oct 26, 2020

For anyone coming here it works if you have engine-strict=true in the projects .npmrc (also not deprecated). Weirdly it works with npm install but not npm install whatever -- but thats another, separate bug :/

@darcyclarke darcyclarke added the Bug thing that needs fixing label Oct 30, 2020
@leandro-manifesto
Copy link

I think NPM should refuse to run any command when the engine-strict is set and the engine checks fail.
That's the default on Yarn and I find it to be a very good behaviour.

@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

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

No branches or pull requests

6 participants
@ljharb @darcyclarke @jnardone @leandro-manifesto @adam-thomas-privitar and others