reactjsnode.jsnext.jsnode-modulesprimereact

Issue with The engine "node" is incompatible with this module


I have been trying to find a fix for this problem

error @primer/primitives@8.2.4: The engine "node" is incompatible with this module. Expected version ">=18.18.0 <18.19.0". Got "22.6.0"
error Found incompatible module.

where only very specific versions of node would work. This is their latest package.

How would I go about fixing this

a temporary fix that i found is using --ignore-engines


Solution

  • Such specific Node version requirement for a package that's intended for client side looks like an accidental mistake and can be tracked to a specific commit with git "blame", or release version via changelog. This PR suggests that the requirement was intended for development only, the author was probably unaware that it will affect projects that use the package as a dependency.

    --ignore-engines flag may not be convenient to use, also it requires to notify other developers that it's necessary and disables valid engine restrictions.

    Until a fix for this package is published, it can be fixed locally with patch-package or similar package, or a version that doesn't contain a regression (@primer/primitives@8.2.3) can be installed. The alternative is to maintain a fork, which can be costly.

    Since this is a bug, the most effective way to make it disappear is to open an issue and optionally create a PR, so it won't be time-consuming for package maintainer to provide a fix.