antongolub / yarn-audit-fix

The missing `yarn audit fix`
MIT License
179 stars 8 forks source link

Cannot install despite being on correct node version #268

Closed Lars-debitroom closed 1 year ago

Lars-debitroom commented 1 year ago

Tried to install and run this but got the following error during installation: pkg-dir@7.0.0: The engine "node" is incompatible with this module. Expected version ">=14.16". Got "14.15.1"

But in the requirements section it is listed as: Requirements Node.js: ^12.20.0 || ^14.13.1 || >=16.0.0

Any idea's on how to fix this?

antongolub commented 1 year ago

@Lars-debitroom,

I'm afraid, nested packages can define their own engine requirements, so the entire rule is the result of their intersecions. I'm rewriting the library for various reasons, and to reduce this impact as well. As a workaround for now, you can suppress this check by setting --ignore-engines.

Lars-debitroom commented 1 year ago

@antongolub Thanks for your reply. I did not know about the --ignore-engines flag so thank you for that! The package was installed successfully with this flag and also ran. Went from a large number of vulnerabilities to a smaller manageable amount.

It might be an idea to add the --ignore-engines flag to the troubleshooting section as a potential workaround for future reference. I can add it in a pull request if interested. Again thanks for the help 🙂

antongolub commented 1 year ago

Any ideas, PRs, bugreports or docs improvements are always welcome.