Building Angular app with 'npm run build' gives NodeJS version error, but 'ng build' works
18:22 29 Jan 2026

For some reason, when I try to run npm run build , Angular complains about the Node version installed. Even though the version it's complaining about is not installed at all, and definitely not the one that NVM currently set to.

I am on Windows. I am testing this on a new, clean ng new app.

I have tried to uninstall NVM and all node/npm directories and Paths and re-installed NVM and re-installed NodeJS via NVM.

Please see the following CLI info:

~> nvm list

    24.13.0
  * 22.22.0 (Currently using 64-bit executable)
    18.20.8
~> node -v
v22.22.0
~> (gcm node).Source // like 'which' for Windows/PowerShell
C:\nvm4w\nodejs\node.exe
~> npm list --global
C:\nvm4w\nodejs -> .\
+-- @angular/cli@19.2.19
+-- corepack@0.34.0
`-- npm@10.9.4
~> ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 19.2.19
Node: 22.22.0
Package Manager: npm 10.9.4
OS: win32 x64

Angular: 19.2.18
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1902.19
@angular-devkit/build-angular   19.2.19
@angular-devkit/core            19.2.19
@angular-devkit/schematics      19.2.19
@angular/cli                    19.2.19
@schematics/angular             19.2.19
rxjs                            7.8.2
typescript                      5.7.3
zone.js                         0.15.1

Running the build with ng:

~> ng build
Initial chunk files   | Names         |  Raw size | Estimated transfer size
main-YQ2F6IQP.js      | main          | 208.30 kB |                56.89 kB
polyfills-B6TNHZQ6.js | polyfills     |  34.58 kB |                11.32 kB
styles-5INURTSO.css   | styles        |   0 bytes |                 0 bytes

                      | Initial total | 242.88 kB |                68.21 kB

Application bundle generation complete. [6.009 seconds]

Output location: C:\Users\xxx\dev\temp\ng-test\dist\ng-test

Running the build with npm:

~> npm run build
> ng-test@0.0.0 build
> ng build
Node.js version v10.19.0 detected.
The Angular CLI requires a minimum Node.js version of v18.19.
Please update your Node.js version or visit https://nodejs.org/ for additional instructions.

I'm at my wits end! What is going on!? Any tips on how to figure this out and fix it?

node.js angular npm