yarn 1 · Build and types
The message
The engine "node" is incompatible with this module. Expected version ">=20"
What it means
The package you are installing declares the Node versions it needs in the engines field, and the version you are running is outside that range. The Expected and Got that follow put the requirement and your version side by side, so those two lines are all you need — and if this only happens in CI, its Node version differs from your machine's. Upgrading with nvm install 20 && nvm use 20 is the direct answer, and writing the same version into .nvmrc and your CI config keeps them from drifting apart again. yarn's --ignore-engines will push past it, but it removes the warning rather than creating compatibility: if the package uses newer syntax, it fails at runtime with a syntax error instead. npm reports the same situation as an EBADENGINE warning and does not block the install by default.
The fix
nvm install 20 && nvm use 20- Printed by
- yarn 1
- Build and types
- 10
Build errors are a tool refusing before anything runs, so they break nothing at the moment they appear — but they do ask two questions: will you fix the type or the path to match the real shape, or will you push that one line through with an as any or a suppression comment — and it is here that the things which are only true on your own machine, letter case, extensions and environment variables, show themselves for the first time.
Reading an error message
- Read from the first line down. The lower you go the more it is about the tool’s internals; the cause is usually at the top.
- If there is a file and a line number, start there — not the top stack frame, but the topmost line that names a file you wrote.
- Search the message verbatim, but strip your own paths and variable names first; those are what stop the search from matching.
- The same condition is worded differently across tool versions. If results look wrong, add the version number to the query.
- Before pasting a fix, check what it throws away. Some of these cannot be undone.
Common questions
Q. What does “The engine "node" is incompatible with this module. Expected version ">=20"” mean?
The package you are installing declares the Node versions it needs in the engines field, and the version you are running is outside that range. The Expected and Got that follow put the requirement and your version side by side, so those two lines are all you need — and if this only happens in CI, its Node version differs from your machine's. Upgrading with nvm install 20 && nvm use 20 is the direct answer, and writing the same version into .nvmrc and your CI config keeps them from drifting apart again. yarn's --ignore-engines will push past it, but it removes the warning rather than creating compatibility: if the package uses newer syntax, it fails at runtime with a syntax error instead. npm reports the same situation as an EBADENGINE warning and does not block the install by default.
Q. How do I fix it?
nvm install 20 && nvm use 20 — before running it, check the explanation above for what this command discards.
Q. Which tool prints this?
yarn 1. It sits under Build and types, and the message runs to 11 words.