How to Fix “the engine ‘node’ is incompatible with this module”

Error the engine node is incompatible with this module occurs when the package you are trying to install is not compatible with your Node.js engine (version).

To fix the error, add the –ignore-engines suffix while installing the package like this:

yarn install --ignore-engines

# OR

yarn global add <your app> --ignore-engines

To get a permanent solution, follow the below steps:

  1. Delete node_modules/, package-lock.json & yarn.lock
  2. Run yarn install or npm i again.

Why does the error occur?

  1. When the Node.js you have installed and the version of the module you are attempting to install are incompatible, you will receive the error.
  2. The error may appear if your installed version of Node.js does not comply with these requirements.
  3. Specific modules might not work with newer or older versions of Node.js because they were created for a specific framework version.
  4. If the requirements of the module you’re trying to install and the dependencies already installed on your system conflict, the error may also occasionally appear.

How to fix it?

If the error is not fixed by adding the –ignore-engines prefix, you can try the solutions below.

Upgrade your Node.js version

You need to upgrade the Node.js version.

Using nvm to upgrade node.js

nvm current node -v # Checks your current version
nvm install <version>

Using homebrew to upgrade node.js

brew update # This updates Homebrew to latest version
brew upgrade node

After upgrading your Node.js to the latest version, you can install the compatible packages with the current Node.js version. This will fix all the issues related to package incompatibility.

After going through all these steps, your issues must be fixed, and now you can install whatever package you like in your node.js environment.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.