If you ever see npm WARN messages inside the terminal about Unsupported engine, it’s because your currently installed node version doesn’t meet the required version for several packages. Here’s one example when installing Tailwind:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@wordpress/prettier-config@4.17.0',
npm WARN EBADENGINE   required: { node: '>=18.12.0', npm: '>=8.19.2' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'esbuild@0.23.1',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-plugin-tailwindcss@3.17.5',
npm WARN EBADENGINE   required: { node: '>=18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'globals@15.13.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }

In the above example, I need to upgrade Node.js to at least v18.18.0 (ideally 20.9.0+ to avoid future issues).

Step 1: check your current node version

node -v

Step 2: Install Latest LTS Version

To upgrade, follow one of these methods:

Option 1: Using Node Version Manager (Recommended)

If you have nvm installed, upgrade Node.js with:

nvm install --lts
nvm use --lts

I’ve done this, skip to step 3

If you don’t have nvm, install it first:

curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
source ~/.bashrc  # or source ~/.zshrc if using zsh
nvm install --lts
nvm use --lts

Option 2: Using Node.js Installer

  1. Go to Node.js official website
  2. Download & install the Latest LTS version (v20.x recommended).
  3. Restart your terminal and check the version again with:
node -v

Step 3: Upgrade npm

Once Node.js is updated, update npm to the latest version:

npm install -g npm

Step 4: Reinstall Dependencies

After upgrading, clear the cache and reinstall your packages:

rm -rf node_modules package-lock.json
npm cache clean --force
npm install

When you run the npm install above, you should see that warnings are gone. This has to be done per project.

Back to blog