angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Can't create additional environment. Environment "local" does not exist.

Open d668 opened this issue 9 years ago • 6 comments

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.2.7 node: 6.4.0 os: win32 x64 @angular/animations: 4.3.3 @angular/common: 4.3.3 @angular/compiler: 4.3.3 @angular/core: 4.3.3 @angular/forms: 4.3.3 @angular/http: 4.3.3 @angular/platform-browser: 4.3.3 @angular/platform-browser-dynamic: 4.3.3 @angular/router: 4.3.3 @angular/cli: 1.2.7 @angular/compiler-cli: 4.3.3 @angular/language-service: 4.3.3

Repro steps.

create a test app with ng new PROJECT-NAME create a file environment.local.ts run ng serve -e=local

The log given by the failure.

Environment "local" does not exist.

d668 avatar Aug 08 '17 12:08 d668

You need to provide environment in .angular-cli.json as it is mentioned in wiki: https://github.com/angular/angular-cli/wiki/stories-application-environments

be4code avatar Aug 08 '17 12:08 be4code

thanks

d668 avatar Aug 08 '17 12:08 d668

Have something change? I can't request for another environment that isn't dev or prod. Anything I add results in a not exist.

A image says more than a thousand words, so:

env eq pre

michaeljota avatar Apr 22 '18 13:04 michaeljota

Why cli can't pick it, since the file naming convention is the same?

pckrishnadas88 avatar Jun 13 '18 13:06 pckrishnadas88

For anyone here, seems like this has actually change for Angular@6. See: Application Environments

michaeljota avatar Jun 13 '18 13:06 michaeljota

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.