So I'm trying to deploy an angular front end to Azure pipeline from GitHub, which uses yaml. However, the job fails at the npm build and install stage, saying 'Your global Angular CLI version (15.2.6) is greater than your local version (15.0.4). The local Angular CLI version is used.' Any idea how i'd resolve this issue?
-
1The CLI version mismatch is just a warning. Your problem might be sending an unknown argument `prod`. perhaps you are looking for something in the line of `--configuration production` instead. `ng build --prod` is deprecated in angular 12 and removed in 14. – Nils Kähler Apr 18 '23 at 08:00
-
Enable diagnostics and run your pipeline again for the detailed error? – SiddheshDesai Apr 18 '23 at 08:02
1 Answers
'Your global Angular CLI version (15.2.6) is greater than your local version (15.0.4). The local Angular CLI version is used
As @Nils Kähler mentioned, this is just a warning; It won't affect your application from running/ building successfully.
But I can see you are getting error:
Error: Unknown argument: prod ##[error] Bash exited with code
1
.
It is mentioned in the official document that --prod
is deprecated in v14 and later versions.
Hence, It is recommended to use
ng build --configuration production
as a fix instead of
ng build --prod
you can also include command "build-prod":"ng build --configuration production"
in your script in package.json as mentioned in SO by Abdullah.
'Your global Angular CLI version (15.2.6) is greater than your local version (15.0.4). The local Angular CLI version is used
To avoid this warning: First, delete package-lock.json file node_modules then proceed to uninstall the existing version and install latest version of the Angular CLI by running the below commands as mentioned in Document:
Locally:
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
Globally:
npm uninstall -g angular-cli
npm install -g @angular/cli@latest
Command to check updated Angular cli version:
ng version

- 2,415
- 2
- 2
- 7