2

I am getting below error when I tried to use ng command

Node.js version v11.13.0 detected. The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0. Please update your Node.js version or visit https://nodejs.org/ for additional instructions.

When I try to see the node version using node -v, I see node version on my machine is v12.18.3 So from where ng is getting v11.13.0? How do I resolve this issue?

enter image description here

R. Richards
  • 24,603
  • 10
  • 64
  • 64
d.Siva
  • 1,140
  • 3
  • 20
  • 42

3 Answers3

1

I tried below steps

  1. Clear the NPM cache
  2. Uninstall both node versions from the NVM
  3. Uninstall anything that starts with node in Control Panel\Programs and Features
  4. Install required node versions in NVM
  5. Install Angular CLI

and things started working for me.

d.Siva
  • 1,140
  • 3
  • 20
  • 42
0

Had the same issue. It turns out installed Angular CLI was not compatible with the installed node and npm version. I used the https://stackoverflow.com/a/60258560 to check the compatibility. Then performed following steps:

  1. Uninstall Angular cli
  2. Uninstall Node and NVM
  3. Installed Node version I wanted (10.x).
  4. Installed specific Angular version corresponding to Node v10 which was Angular Cli v11 at this time.
MACK
  • 21
  • 6
0

I was also facing the same issue in my Windows machine where the node -v version and the version picked up by ng command were different. This was because my node.js command prompt was picking the version from AppData\Roaming\npm folder. Cleaning up this folder fixed the issue for me.

  1. Uninstall node
  2. Empty the contents from C:\Users<user>\AppData\Roaming\npm
  3. Install the required node version
Sarun
  • 161
  • 1
  • 8