The Angular CLI requires a minimum Node.js version of either

avatar
Borislav Hadzhiev

Last updated: Apr 4, 2024
3 min

banner

# The Angular CLI requires a minimum Node.js version of either

The error "The Angular CLI requires a minimum Node.js version of either" occurs when your Node.js version is not supported by the Angular CLI.

To solve the error, install the long-term supported version of Node.

angular cli requires minimum node js version of either

Here is the complete stack trace:

shell
Node.js version v12.22.12 detected. The Angular CLI requires a minimum Node.js version of either v14.20, v16.13 or v18.10. Please update your Node.js version or visit https://nodejs.org/ for additional instructions. Warning: The current version of Node (19.8.1) is not supported by Angular.

The error usually occurs if your Node.js version is very outdated and no longer supported by the Angular CLI.

You can use the node -v command to check your version of Node.js.

shell
node -v

check node version 12

Conversely, if your Node.js version is more recent and not yet supported by the CLI, you will get the following warning:

  • Warning: The current version of Node (19.8.1) is not supported by Angular.

In theory, you could ignore the warning and try to use the Angular CLI with your current Node.js version but it is much safer to use one of the officially supported versions.

The following table shows the supported Node.js versions for a given Angular CLI version.

The safest bet is to install the long-term supported version of Node.js.

Picking the long-term supported Node.js version is your safest bet because the Angular CLI is guaranteed to support it.

There are a couple of packages that you can use to manage your Node.js version.

You can click on any of the links to view the installation instructions.

An alternative approach is to install the long-term supported version from the official nodejs.org website.

Either package works fine, however, installing nvm for Windows is a bit more involved.

Installing nvm for macOS and Linux only takes a single command.

# Using NVM for macOS and Linux

Make sure you have NVM for macOS and Linux installed to be able to run the following commands.

I have written a step-by-step guide on how to install NVM on macOS and Linux.

If you use nvm to manage your Node.js version, you can issue the following commands to switch to the long-term supported version.

shell
# NVM for macOS and Linux nvm install --lts nvm use --lts npm install -g @angular/cli

install lts node version

After you switch to the LTS version, try to issue the ng version command to verify the issue is resolved.

shell
ng version

# Using NVM for Windows

If you use NVM for Windows, you would issue the following commands to switch to the LTS version.

I have written a step-by-step guide on how to install NVM on Windows.

Make sure you have the package installed to be able to run the commands.
shell
# NVM for Windows nvm install lts nvm use lts npm install -g @angular/cli

nvm windows install node lts version

# Using the n package

If you use the n package, you can switch to the LTS version by issuing the following commands.

Make sure you have the package installed to be able to run the commands.
shell
n lts npm install -g @angular/cli

# Using the volta package

If you use volta, you would use the following commands to switch to the LTS version.

Make sure you have the package installed to be able to run the commands.
shell
# installs the LTS version volta install node

Once you've switched to a supported Node.js version, try issuing the ng version command.

shell
ng version npm install -g @angular/cli

If you get an error that your global CLI version is greater than your local version, check out my other article:

Now that your Node.js version is the LTS one, you should be able to run Angular commands without any issues.

The following table shows the supported Node.js versions for a given Angular CLI version.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

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.