22

I just installed the latest version of node(16.8) using nvm and angular/cli(12.2).

But when i run ng --version

It shows the following:

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

I tried to downgrade the node and installed node 14.15 but ng is not working anymore.

Should i ignore the warning and use node 16?.

Why is ng not working with node 14.15?.

PS: I am using nvm to manage the different node versions

walexy
  • 609
  • 2
  • 7
  • 16

5 Answers5

11

You can use Angular CLI with Node >=14 version. Command not working, because you switched to another nvm node version with it's own installed packages. You have to install angular cli again on your node 14.15. npm install -g @angular/cli

Anton Marinenko
  • 2,749
  • 1
  • 10
  • 16
11

Kindly go the the flowing link to install the compatible Node version supported by different Angular versions:

Angular And Node.Js Compatibility

Select the angular core version for checking it's compatibility as per your need as shown in the below Image:

angular-core version compatibility

Mohammed Altaf
  • 151
  • 1
  • 5
10
nvm use <previous-version>
npm uninstall -g @angular/cli
nvm use 16
npm install -g @angular/cli
ng version

This worked for me.

rrkjonnapalli
  • 357
  • 1
  • 3
  • 7
  • With one amendment. The node version should be higher than 16.14. So eventually install this version nvm install 16.14.2 then: ... nvm use 16.14.x (or higher) ... – ittradco May 26 '23 at 19:49
1

Uninstall latest node.js version from your system and install expected or lower version of node.js as per angular requirement.

https://angular.io/guide/setup-local

Venkatesh Boya
  • 564
  • 5
  • 11
  • 1
    You don't have to uninstall node version from your computer. You may have several versions of npm and use the required one accordingly. >> nvm use "required version" – Gi1ber7 Feb 02 '23 at 16:55
0

This kind of issue may comes in a situation where you shift between different node versions. That means when you uninstall an old version of node and install Current/Latest node version.

The reason for this issue that Angular requires an active LTS or maintenance LTS version of Node.js. Refer Angular-setup-local documentation.

Since you installed Current/Latest version of node you are getting above warning. To resolve this warning you can shift to LTS version of Node.js by following below steps.

At this time LTS version of node is 18.17.1 Refer Node Versions

  • Install Node Version Manager (NVM) to change node version. Refer How to downgrade to a previous Node version. Windows user use this nvm-windows/releases assets
  • After that run nvm install 18.17.1 to install LTS version
  • Then run nvm use 18.17.1 to switch to desired version
  • Now run node -v to check node version - it should v18.17.1
  • Finally run ng v you won't get above warning now.
AHAMED AAQIB
  • 336
  • 4
  • 12