npm WARN npm does not support Node.js v16 error [Solved]

avatar
Borislav Hadzhiev

Last updated: Apr 4, 2024
3 min

banner

# npm WARN npm does not support Node.js v16 error [Solved]

The error "npm WARN npm does not support Node.js vX.Y.Z" occurs when you have incompatible versions of npm and Node.js installed.

To solve the error, update your version of npm and use the long-term supported version of Node.js if your version is outdated.

shell
npm WARN npm does not support Node.js v16.17.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12. npm WARN npm You can find the latest version at https://nodejs.org/ npm ERR! cb.apply is not a function npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Bobbyhadz\AppData\Roaming\npm-cache\_logs\2022-12-05T20_34_30_197Z-debug.log

The first thing you should try is to update your npm version.

Open your terminal and run the following command.

shell
npm install -g npm@latest # 👇️ If you get a permissions error on macOS/Linux sudo npm install -g npm@latest

update npm version

If you get a permissions error on Windows, open CMD as an administrator and rerun the command.

To open CMD as an administrator:

  1. Click on the Search bar and type CMD.

  2. Right-click on the Command Prompt application and click "Run as administrator".

run cmd as administrator

  1. Rerun the command.
shell
npm install -g npm@latest npm install -g npm@latest --force

Try to run the npm install command after updating your npm version.

If the error persists, try to install the long-term supported version of Node.js.

If you are on macOS or Linux, you can also run the following command to update your NPM version.

shell
curl https://www.npmjs.com/install.sh | sudo sh

If the error is not resolved use nvm or n to update your Node.js version to the long-term supported one.

# Update your Node.js version to the long-term supported one

You can check your Node.js version with the node --version command.

You can use the node --version command to get your Node.js version.

shell
node --version

get node version

If you use nvm, you can update your version of Node.js and npm with the following 2 commands.

shell
nvm install --lts nvm use --lts

install lts node js version

You can also use the n package to manage your Node.js version.

shell
npm cache clean -f npm install -g n n stable

If you get a permissions error when issuing the commands, open CMD as an administrator (Windows) or prefix the commands with sudo (macOS and Linux).

shell
sudo npm cache clean -f sudo npm install -g n sudo n stable

Alternatively, you can download the long-term supported version of Node.js from the official nodejs.org website.

If you want to use nvm to manage your Node.js version, There are 2 nvm packages:

If you are on macOS or Linux, click on the following link to install NVM.

I've also written a detailed, step-by-step guide on how to install NVM on Windows.

Once you install NVM and switch to the long-term supported version of Node.js, the error will be resolved.

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.