Last updated: Apr 4, 2024
Reading time·3 min
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.
Here is the complete stack trace:
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.
node -v
Conversely, if your Node.js version is more recent and not yet supported by the CLI, you will get the following warning:
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.
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.
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.
# NVM for macOS and Linux nvm install --lts nvm use --lts npm install -g @angular/cli
After you switch to the LTS version, try to issue the ng version
command to
verify the issue is resolved.
ng version
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.
# NVM for Windows nvm install lts nvm use lts npm install -g @angular/cli
n
packageIf you use the n package, you can switch to the LTS version by issuing the following commands.
n lts npm install -g @angular/cli
volta
packageIf you use volta, you would use the following commands to switch to the LTS version.
# installs the LTS version volta install node
Once you've switched to a supported Node.js version, try issuing the
ng version
command.
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.
You can learn more about the related topics by checking out the following tutorials: