首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在文件替换中构建..\src\environments\environment.dev.ts路径不存在

在文件替换中构建..\src\environments\environment.dev.ts路径不存在
EN

Stack Overflow用户
提问于 2019-05-27 13:21:53
回答 1查看 3.3K关注 0票数 1

我正在尝试执行ng build --configuration=development,但是它给出了以下错误:

文件替换中的C:\Users\Marina\Desktop\heliosFrontEnd_admin\src\environments\environment.dev.ts路径不存在。错误:文件替换中的C:\Users\Marina\Desktop\heliosFrontEnd_admin\src\environments\environment.dev.ts路径不存在。(C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules@angular-devkit\build-angular\src\utils\normalize-file-replacements.js:25:19) at Object.normalizeBuilderSchema (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules@angular-devkit\build-angular\src\utils\normalize-builder-schema.js:37:97) at BrowserBuilder.run (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules@angular-devkit\build-angular\src\browser\index.js:31:33) at MergeMapSubscriber.getBuilderDescription.pipe.operators_1.concatMap.builder as project at MergeMapSubscriber._tryNext (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\operators\mergeMap.js:69:27) at MergeMapSubscriber._next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\operators\mergeMap.js:59:18( (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\Subscriber.js:67:18) at MapSubscriber._next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\operators\map.js:55:26) at MapSubscriber.Subscriber.next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\Subscriber.js:67:18) )(C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\operators\tap.js:65:26) at TapSubscriber.Subscriber.next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\Subscriber.js:67:18) at MergeMapSubscriber.notifyNext (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\operators\mergeMap.js:92:26)在InnerSubscriber._next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\InnerSubscriber.js:28:21) at InnerSubscriber.Subscriber.next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\Subscriber.js:67:18) at MapSubscriber._next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\operators\map.js:55:26) at MapSubscriber。Subscriber.next (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules\rxjs\internal\Subscriber.js:67:18)

在我的angular.json文件中

代码语言:javascript
复制
"build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.ico",
              "src/config"
            ],
            "styles": [
              "node_modules/perfect-scrollbar/css/perfect-scrollbar.css",
              "src/assets/scss/material-dashboard.scss",
              "src/assets/css/demo.css"
            ],
            "scripts": [
              "node_modules/jquery/dist/jquery.js",
              "node_modules/popper.js/dist/umd/popper.js",
              "node_modules/bootstrap-material-design/dist/js/bootstrap-material-design.min.js",
              "node_modules/arrive/src/arrive.js",
              "node_modules/moment/moment.js",
              "node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js",
              "node_modules/bootstrap-notify/bootstrap-notify.js",
              "node_modules/chartist/dist/chartist.js"
            ]
          },
          "configurations": {
            "development": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.dev.ts"
                }
              ]
            },

我检查了路径,它是正确的,文件在那里。怎么啦?

EN

回答 1

Stack Overflow用户

发布于 2019-05-27 17:32:38

在“配置”之后,您必须看到“服务”。

增加开发。

代码语言:javascript
复制
 "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "{your_project_name}:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "{your_project_name}:build:production"
            },
            "development": {
              "browserTarget": "{your_project_name}:build:development"
            }
          }
        },
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56326948

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档