Closed henderea closed 10 months ago
Node 18 is in maintenance mode as of yesterday. So it seems prudent to loosen engines
to allow Node 20.
Thanks all, should be an easy PR I'd be happy to merge.
Thanks @galenhuntington, released in https://github.com/JamieMason/ImageOptim-CLI/releases/tag/3.1.9
Steps To Reproduce The Error
Add this to
~/.npmrc
:Then, using NodeJS version 20.x, try to install the latest version 3.1.7
Expected Behaviour
It installs successfully
Actual Behaviour
It claims the node version is unsupported
Version Numbers or N/A
Help Needed
Please update the engine section in the
package.json
to be greater than or equal to 18, rather than exactly 18. In other words, the value should be">=18"
, not"^18.0.0"
.Output of
npm install -g imageoptim-cli@latest
:As a note, if you don't have
engine-strict=true
in your~/.npmrc
, things work fine. I just happen to normally use that setting.If the package will only work on node 18 and up, I would recommend setting the following in the
package.json
:By setting
engineStrict
totrue
in thepackage.json
, you will block npm from installing the package on older versions even if the user doesn't set the property in their~/.npmrc
. Which would be almost everyone other than me 😅If you don't set
engineStrict
totrue
in thepackage.json
, then almost anyone would be able to install the latest version on NodeJS versions before 18, like 16 or 14. And I'm assuming that probably won't work well.