1
votes

I'm trying to do ng build --configuration=development but it gives the following error:

The C:\Users\Marina\Desktop\heliosFrontEnd_admin\src\environments\environment.dev.ts path in file replacements does not exist. Error: The C:\Users\Marina\Desktop\heliosFrontEnd_admin\src\environments\environment.dev.ts path in file replacements does not exist. at Object.normalizeFileReplacements (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] (C:\Users\Marina\Desktop\heliosFrontEnd_admin\node_modules@angular\cli\node_modules@angular-devkit\architect\src\architect.js:121:415) 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) at MergeMapSubscriber.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) at TapSubscriber._next (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) at 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)

In my angular.json file I have

"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"
                }
              ]
            },

I've checked the path and it is correct, the file is there. What is wrong?

1
do you have a file named environment.dev.ts? - Reza
Yes I have the file and it is in the path I've specified - Usr
Usually for development doesn't need to mention the environment params, do you specifically want to do that? so ng build will build dev for you, and doesn't need to have a file named env...dev.ts - Reza
can you confirm if you can open this path C:\Users\Marina\Desktop\heliosFrontEnd_admin\src\environments\environment.dev.ts - Reza

1 Answers

1
votes

After "configurations" you must see "serve".

Add development.

 "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"
            }
          }
        },