Error during migration from npm to yarn - The engine "node" is incompatible with this module

Viewed 3042

in my project I am trying to migrate from npm to yarn.

I simply ran the "yarn" command to generate the "yarn.lock".

During the process, it showed me the following error:

error linearicons@1.0.2: The engine "node" is incompatible with this module.

Expected version "^12.13.0". Got "10.19.0" error Found incompatible module.

So I ran the command "npm remove linearicons" then "yarn" to generate the "yarn.lock" without error, then "yarn add linearicons". But it gives me the same error as above.

My Yarn version is 1.22.10

Node version : v10.19.0

What could I do to fix this problem? I don't understand what he wants

2 Answers

Update the node.js version :

Installation of nvm

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
$ source ~/.bashrc

Looking for existent versions of node.js

$ nvm ls-remote

Installation of the last one (as of today)

$ nvm install v16.8.0

After that your issue should be fixed.

yarn install --ignore-engines

This worked for me, and it was showing this error:

 webpack-dev-server@4.5.0: The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "10.19.0"

Final result after --ignore-engines

success Saved lockfile.
Related