In this article, we will see how to solve "the engine node is incompatible with this module" error. If you are using yarn package manager then this error might look familiar to you as it is very commonly occurred error. I have also encountered this error while I tried to install a package through yarn. This triggered me to write this article and share the resolution steps as I thought many of the folks like me might be facing this issue out there. It will help them solve this issue very quickly.
Before solving this issue, lets understand why this error occurs. Well, most of the time it has been observed that yarn throws this error when one of its configuration parameter known as "ignore-engines" is not configured properly. So setting this parameter to yes solves the problem. This can be further understood by looking through below example where I have shown how I was getting "the engine node is incompatible with this module" error while trying to install "jest" package through yarn package manager and setting config parameter "ignore-engines" to yes solved my issue.

Solved "The engine node is incompatible with this module"
Also Read: How to Install pycoin(Bitcoin Client) on Linux (RHEL/Ubuntu/Rocky Linux)
Like I said earlier, when I was trying to add jest package in my current project using sudo yarn add jest command then I noticed The engine "node" is incompatible with this module error on the output as shown below.
cyberithub@ubuntu:~$ sudo yarn add jest yarn add v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... error @jest/core@28.1.0: The engine "node" is incompatible with this module. Expected version "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0". Got "10.19.0" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
So, if you are also getting above error then one of the solution is to just set the value of ignore-engines to true by using sudo yarn config set ignore-engines true command as shown below.
cyberithub@ubuntu:~$ sudo yarn config set ignore-engines true yarn config v1.22.19 success Set "ignore-engines" to "true". Done in 0.05s.
After setting the above value I tried adding the package again using same sudo yarn add jest command and this time I noticed that it is getting successfully added as shown below.
cyberithub@ubuntu:~$ sudo yarn add jest yarn add v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 191 new dependencies. info Direct dependencies └─ jest@28.1.0 info All dependencies ├─ @ampproject/remapping@2.2.0 ├─ @babel/compat-data@7.17.10 ├─ @babel/core@7.17.12 ├─ @babel/helper-compilation-targets@7.17.10 ├─ @babel/helper-function-name@7.17.9 ├─ @babel/helper-hoist-variables@7.16.7 ├─ @babel/helper-module-imports@7.16.7 ├─ @babel/helper-module-transforms@7.17.12 ├─ @babel/helper-plugin-utils@7.17.12 ├─ @babel/helper-simple-access@7.17.7 ├─ @babel/helper-validator-option@7.16.7 ├─ @babel/helpers@7.17.9 ├─ @babel/highlight@7.17.12 ├─ @babel/plugin-syntax-async-generators@7.8.4 ├─ @babel/plugin-syntax-bigint@7.8.3 ├─ @babel/plugin-syntax-class-properties@7.12.13 ├─ @babel/plugin-syntax-import-meta@7.10.4 ├─ @babel/plugin-syntax-json-strings@7.8.3 ├─ @babel/plugin-syntax-logical-assignment-operators@7.10.4 ├─ @babel/plugin-syntax-nullish-coalescing-operator@7.8.3 ├─ @babel/plugin-syntax-numeric-separator@7.10.4 ├─ @babel/plugin-syntax-object-rest-spread@7.8.3 ├─ @babel/plugin-syntax-optional-catch-binding@7.8.3 ├─ @babel/plugin-syntax-optional-chaining@7.8.3 ├─ @babel/plugin-syntax-top-level-await@7.14.5 ├─ @babel/plugin-syntax-typescript@7.17.12 ├─ @babel/template@7.16.7 ├─ @babel/traverse@7.17.12 ├─ @bcoe/v8-coverage@0.2.3 ├─ @istanbuljs/load-nyc-config@1.1.0 ├─ @jest/globals@28.1.0 ├─ @jest/reporters@28.1.0 ├─ @jest/source-map@28.0.2 ├─ @jest/test-sequencer@28.1.0 ├─ @jridgewell/gen-mapping@0.3.1 ├─ @jridgewell/resolve-uri@3.0.7 ├─ @sinclair/typebox@0.23.5 ├─ @sinonjs/commons@1.8.3 ├─ @sinonjs/fake-timers@9.1.2 ├─ @types/babel__generator@7.6.4 ├─ @types/babel__template@7.4.1 ├─ @types/graceful-fs@4.1.5 ├─ @types/istanbul-lib-coverage@2.0.4 ├─ @types/istanbul-lib-report@3.0.0 ├─ @types/istanbul-reports@3.0.1 ├─ @types/prettier@2.6.1 ├─ @types/stack-utils@2.0.1 ├─ @types/yargs-parser@21.0.0 ├─ @types/yargs@17.0.10 ├─ ansi-styles@4.3.0 ├─ anymatch@3.1.2 ├─ argparse@1.0.10 ├─ babel-jest@28.1.0 ├─ babel-plugin-jest-hoist@28.0.2 ├─ babel-preset-jest@28.0.2 ├─ balanced-match@1.0.2 ├─ brace-expansion@1.1.11 ├─ braces@3.0.2 ├─ browserslist@4.20.3 ├─ bser@2.1.1 ├─ buffer-from@1.1.2 ├─ callsites@3.1.0 ├─ camelcase@6.3.0 ├─ caniuse-lite@1.0.30001341 ├─ char-regex@1.0.2 ├─ cjs-module-lexer@1.2.2 ├─ cliui@7.0.4 ├─ co@4.6.0 ├─ color-convert@2.0.1 ├─ color-name@1.1.4 ├─ concat-map@0.0.1 ├─ convert-source-map@1.8.0 ├─ cross-spawn@7.0.3 ├─ dedent@0.7.0 ├─ deepmerge@4.2.2 ├─ detect-newline@3.1.0 ├─ diff-sequences@28.0.2 ├─ electron-to-chromium@1.4.137 ├─ emoji-regex@8.0.0 ├─ error-ex@1.3.2 ├─ escape-string-regexp@2.0.0 ├─ esprima@4.0.1 ├─ fast-json-stable-stringify@2.1.0 ├─ fb-watchman@2.0.1 ├─ fill-range@7.0.1 ├─ find-up@4.1.0 ├─ fs.realpath@1.0.0 ├─ function-bind@1.1.1 ├─ gensync@1.0.0-beta.2 ├─ get-caller-file@2.0.5 ├─ get-package-type@0.1.0 ├─ get-stream@6.0.1 ├─ glob@7.2.3 ├─ globals@11.12.0 ├─ has@1.0.3 ├─ html-escaper@2.0.2 ├─ human-signals@2.1.0 ├─ imurmurhash@0.1.4 ├─ inflight@1.0.6 ├─ inherits@2.0.4 ├─ is-arrayish@0.2.1 ├─ is-core-module@2.9.0 ├─ is-fullwidth-code-point@3.0.0 ├─ is-generator-fn@2.1.0 ├─ is-number@7.0.0 ├─ is-stream@2.0.1 ├─ isexe@2.0.0 ├─ istanbul-lib-instrument@5.2.0 ├─ istanbul-lib-source-maps@4.0.1 ├─ istanbul-reports@3.1.4 ├─ jest-changed-files@28.0.2 ├─ jest-circus@28.1.0 ├─ jest-cli@28.1.0 ├─ jest-docblock@28.0.2 ├─ jest-each@28.1.0 ├─ jest-leak-detector@28.1.0 ├─ jest-pnp-resolver@1.2.2 ├─ jest-resolve-dependencies@28.1.0 ├─ jest@28.1.0 ├─ js-tokens@4.0.0 ├─ js-yaml@3.14.1 ├─ jsesc@2.5.2 ├─ json-parse-even-better-errors@2.3.1 ├─ json5@2.2.1 ├─ kleur@3.0.3 ├─ leven@3.1.0 ├─ lines-and-columns@1.2.4 ├─ locate-path@5.0.0 ├─ lru-cache@6.0.0 ├─ make-dir@3.1.0 ├─ makeerror@1.0.12 ├─ mimic-fn@2.1.0 ├─ minimatch@3.1.2 ├─ ms@2.1.2 ├─ natural-compare@1.4.0 ├─ node-int64@0.4.0 ├─ node-releases@2.0.4 ├─ normalize-path@3.0.0 ├─ npm-run-path@4.0.1 ├─ onetime@5.1.2 ├─ p-limit@2.3.0 ├─ p-locate@4.1.0 ├─ p-try@2.2.0 ├─ parse-json@5.2.0 ├─ path-exists@4.0.0 ├─ path-is-absolute@1.0.1 ├─ path-key@3.1.1 ├─ path-parse@1.0.7 ├─ picocolors@1.0.0 ├─ picomatch@2.3.1 ├─ pirates@4.0.5 ├─ pkg-dir@4.2.0 ├─ prompts@2.4.2 ├─ react-is@18.1.0 ├─ require-directory@2.1.1 ├─ resolve-cwd@3.0.0 ├─ resolve.exports@1.1.0 ├─ resolve@1.22.0 ├─ rimraf@3.0.2 ├─ safe-buffer@5.1.2 ├─ semver@6.3.0 ├─ shebang-command@2.0.0 ├─ shebang-regex@3.0.0 ├─ signal-exit@3.0.7 ├─ sisteransi@1.0.5 ├─ source-map-support@0.5.13 ├─ source-map@0.6.1 ├─ sprintf-js@1.0.3 ├─ string-width@4.2.3 ├─ strip-bom@4.0.0 ├─ strip-final-newline@2.0.0 ├─ strip-json-comments@3.1.1 ├─ supports-color@7.2.0 ├─ supports-hyperlinks@2.2.0 ├─ supports-preserve-symlinks-flag@1.0.0 ├─ terminal-link@2.1.1 ├─ test-exclude@6.0.0 ├─ tmpl@1.0.5 ├─ to-fast-properties@2.0.0 ├─ to-regex-range@5.0.1 ├─ type-detect@4.0.8 ├─ type-fest@0.21.3 ├─ v8-to-istanbul@9.0.0 ├─ walker@1.0.8 ├─ which@2.0.2 ├─ wrap-ansi@7.0.0 ├─ write-file-atomic@4.0.1 ├─ y18n@5.0.8 ├─ yallist@4.0.0 ├─ yargs-parser@21.0.1 └─ yargs@17.5.1 Done in 5.84s.
This confirms that yarn installed jest package without any further error which in turn confirms the error "the engine node is incompatible with this module" has been resolved successfully. In case, if you are still facing the same error after following above resolution steps, please do let me know in comment box so that I can take a look into this. Please let me know if you have any other feedback or comments on this.