---
title: "The engine \"node\" is incompatible with this module"
description: "This error means a package's engines field asks for a different Node version than you are running. Learn how to read it, switch versions with .nvmrc and pin your package manager."
url: https://www.danny.engineering/answer/nodejs/the-engine-node-is-incompatible-with-this-module
author: Danny
published: 2026-11-27T00:00:00.000Z
updated: 2026-11-27T17:23:00.000Z
tags: ["Node.js"]
---

# The engine "node" is incompatible with this module

## The short answer


A package you are installing says, in its `engines` field, which Node versions it supports, and your current Node is outside that range. Switch to a version that matches, ideally the one your project pins in `.nvmrc`, then install again.


```bash
node --version

# Switch to the version in .nvmrc (or install it)
nvm install
nvm use

rm -rf node_modules
npm install
```


## Why it happens


Packages can declare the Node versions they work with in `package.json`:


```json
{
  "engines": {
    "node": ">=22"
  }
}
```


Package managers compare that range with the Node you are running. The exact message depends on the tool:


```bash
# Yarn 1
error some-package@3.0.0: The engine "node" is incompatible with this module. Expected version ">=22". Got "20.18.0"

# npm
npm warn EBADENGINE Unsupported engine { package: 'some-package@3.0.0', required: { node: '>=22' }, current: { node: 'v20.18.0' } }
```


Yarn 1 stops the install. npm only warns, unless `engine-strict` is turned on. pnpm warns for dependencies and fails if your own project's `engines` does not match.


This error is showing up more often now because Node 20 reached end of life in April 2026, and many packages have raised their minimum to Node 22 or later. The current LTS lines are Node 24 and Node 26, with Node 22 in maintenance until April 2027.


## How to fix it


### Upgrade Node with a version manager


The right fix is almost always to use a supported Node version. With nvm or fnm you can install one next to your current version:


```bash
nvm install --lts
nvm alias default lts/*
```


In CI, set the version explicitly, for example `node-version-file: .nvmrc` in the `actions/setup-node` step on GitHub Actions.


### Pin the version for the whole team


Add a `.nvmrc` file at the project root so everyone uses the same major version. nvm and fnm both read it, and fnm also reads `.node-version`.


```bash
echo "24" > .nvmrc
```


Then state the same range in your own `engines` field, so anyone on the wrong version gets told straight away:


```json
{
  "engines": {
    "node": ">=24"
  }
}
```


To make npm fail instead of warn, add an `.npmrc` file to the project:


```bash
echo "engine-strict=true" >> .npmrc
```


### Pin the package manager too


Version mismatches sometimes come from the package manager rather than Node, for example a different major version of pnpm or Yarn. Record the exact version in the `packageManager` field:


```json
{
  "packageManager": "pnpm@10.0.0"
}
```


Corepack reads this field and runs that exact version. It ships with Node 24 and earlier, but it is no longer bundled from Node 25, so on Node 26 install it first:


```bash
npm install -g corepack
corepack enable
```


### Use an older package version as a stopgap


If you really cannot upgrade Node yet, install the last version of the package that supports yours. Check its changelog to find it.


```bash
npm install some-package@2
```


### Ignore the check only as a last resort


Yarn 1 has `--ignore-engines`. It gets the install through, but the package may use APIs your Node does not have and fail at runtime, so treat it as temporary.


## Common pitfalls

- Switching Node and keeping the old `node_modules`. Native modules are compiled for a specific Node version; reinstall after switching.
- Having a `.nvmrc` but never running `nvm use`. Set up your shell to switch automatically, or use fnm with `--use-on-cd`.
- A CI image with a different Node version from your laptop. Read the version from `.nvmrc` in CI too.
- Setting `engines` to an exact version such as `24.3.0`. Use a range so patch updates still work.
- Turning off the check globally with `engine-strict=false` and forgetting about it.

## Related reading

- [npm Docs: package.json engines](https://docs.npmjs.com/cli/configuring-npm/package-json#engines)
- [Node.js: Release schedule](https://nodejs.org/en/about/previous-releases)
