Angular CLI – Fixing Unknown option: ‘–environment’

This post shows you how to solve “Unknown option: ‘–environment’” error when you are trying to build your Angular application with Angular CLI using the command like this:

ng build --environment=prod

You get the “Unknown option: ‘–environment'” error because you have installed angular/cli v6+ while the above command works in angular/cli 1.x only.

The solution is to use the new command as shown right below:

ng build --configuration=production

 

Learn more about How to build an Angular application in Production mode with Angular CLI

0 0 vote
Article Rating
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Alex Sardi
Alex Sardi
2 years ago

Thank you very very much <3

Anatolio
Anatolio
2 years ago

Good!

2
0
Would love your thoughts, please comment.x
()
x