Angular 7运行-o -c env

时间:2018-10-25 16:07:53

标签: angular angular-cli angular7

前一段时间,我正在使用angular 6并使用ng serve -o -c env_i_wanted测试不同的环境。

我在angular.json文件中的配置下添加了所需的环境。

在角度7中,我尝试了相同的操作,但得到了这样的内容:

Project 'stage' could not be found in workspace.
Error: Project 'stage' could not be found in workspace.
    at Workspace.getProject (/Users/zjarr/Documents/Oktara/Websites/GoSweatHome/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:93:19)
    at Architect.getBuilderConfiguration (/Users/zjarr/Documents/Oktara/Websites/GoSweatHome/node_modules/@angular/cli/node_modules/@angular-devkit/architect/src/architect.js:96:41)
    at ServeCommand.initialize (/Users/zjarr/Documents/Oktara/Websites/GoSweatHome/node_modules/@angular/cli/models/architect-command.js:81:52)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

阶段是我要使用的环境

1 个答案:

答案 0 :(得分:0)

发现它现在需要项目名称:https://angular.io/cli/serve

例如:ng s project_name -o --c stage