发生未处理的异常:项目不存在

时间:2020-03-31 18:52:19

标签: angular angular8

我正在尝试在我的角度应用程序中使用i18n进行国际化。但是我收到此错误“发生未处理的异常:项目不存在。”

请问我在做什么错?我使用了“ ng xi18n --output-path translation”来生成我的英语和法语翻译文件。但是当我运行此命令“ ng build --configuration = fr”时,我一直在获取不存在的项目

{
      "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
      "version": 1,
      "newProjectRoot": "projects",
      "projects": {
        "door": {
          "projectType": "application",
          "schematics": {},
          "root": "",
          "sourceRoot": "src",
          "prefix": "app",
          "architect": {
            "build": {
              "builder": "@angular-devkit/build-angular:browser",

              "options": {
                "outputPath": "dist/door",
                "index": "src/index.html",
                "main": "src/main.ts",
                "polyfills": "src/polyfills.ts",
                "tsConfig": "tsconfig.app.json",
                "aot": false,
                "assets": [
                  "src/favicon.ico",
                  "src/assets"
                ],
                "styles": [
                  "src/styles.css"
                ],
                "scripts": []
              },

              "configurations": {
                "production-fr": {
                  "optimization": true,
                  "outputHashing": "all",
                  "outputPath": "dist/browser/fr/",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true,
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.prod.ts"
                    }
                  ],
                  "baseHref": "/fr/",
                  "i18nFile": "src/locale/messages.fr.xlf",
                  "i18nFormat": "xlf",
                  "i18nLocale": "fr",
                  "i18nMissingTranslation": "error"
                },

                "production-en": {
                  "optimization": true,
                  "outputHashing": "all",
                  "outputPath": "dist/browser/en/",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true,
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.prod.ts"
                    }
                  ],
                  "baseHref": "/en/",
                  "i18nFile": "src/locale/messages.en.xlf",
                  "i18nFormat": "xlf",
                  "i18nLocale": "en",
                  "i18nMissingTranslation": "error"
                }
              },

                "production": {
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.prod.ts"
                    }
                  ],

                  "optimization": true,
                  "outputHashing": "all",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true,
                  "budgets": [
                    {
                      "type": "initial",
                      "maximumWarning": "2mb",
                      "maximumError": "5mb"
                    },
                    {
                      "type": "anyComponentStyle",
                      "maximumWarning": "6kb",
                      "maximumError": "10kb"
                    }
                  ]
                }



            },
            "serve": {
              "builder": "@angular-devkit/build-angular:dev-server",

              "options": {
                "browserTarget": "door:build"
              },
              "configurations": {
                "production": {
                  "browserTarget": "door:build:production"
                },
                "fr": {
                  "browserTarget": "i18n-demo:build:production-fr"
                },
                "en": {
                  "browserTarget": "i18n-demo:build:production-en"
                }
              }
            },
            "extract-i18n": {
              "builder": "@angular-devkit/build-angular:extract-i18n",
              "options": {
                "browserTarget": "door:build"
              }
            },

            "test": {
              "builder": "@angular-devkit/build-angular:karma",
              "options": {
                "main": "src/test.ts",
                "polyfills": "src/polyfills.ts",
                "tsConfig": "tsconfig.spec.json",
                "karmaConfig": "karma.conf.js",
                "assets": [
                  "src/favicon.ico",
                  "src/assets"
                ],
                "styles": [
                  "src/styles.css"
                ],
                "scripts": []
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": [
                  "tsconfig.app.json",
                  "tsconfig.spec.json",
                  "e2e/tsconfig.json"
                ],
                "exclude": [
                  "**/node_modules/**"
                ]
              }
            },
            "e2e": {
              "builder": "@angular-devkit/build-angular:protractor",
              "options": {
                "protractorConfig": "e2e/protractor.conf.js",
                "devServerTarget": "door:serve"
              },
              "configurations": {
                "production": {
                  "devServerTarget": "door:serve:production"
                }
              }
            }
          }
        }},
      "defaultProject": "door"
    }

0 个答案:

没有答案