我开始收到此错误:错误:架构验证失败,出现以下错误:数据路径“”必须具有必需的属性“browserTarget”

问题描述 投票:0回答:1

如何解决? 这是我的 angular.json 文件:

{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", “版本”:1, "newProjectRoot": "项目", “项目”:{ “侦察应用程序”:{ “项目类型”:“应用程序”, “示意图”:{ “@schematics/角度:组件”:{ “独立”:假 }, “@schematics/角度:指令”:{ “独立”:假 }, “@schematics/角度:管道”:{ “独立”:假 } }, “根”: ””, "sourceRoot": "src", “前缀”:“应用程序”, “建筑师”:{ “建造”: { “构建器”:“@angular-devkit/build-angular:浏览器”, “选项”: { "outputPath": "dist/recon-app", "index": "src/index.html", "main": "src/main.ts", “polyfills”:[ “区域.js” ], "tsConfig": "tsconfig.app.json", “资产”:[ “src/favicon.ico”, “src/资产” ], “样式”:[ “@angular/material/prebuilt-themes/indigo-pink.css”, “src/styles.css” ], “脚本”:[“node_modules / bootstrap / dist / js / bootstrap.bundle.min.js”] }, “配置”:{ “生产”: { “预算”:[ { “类型”:“初始”, “最大警告”:“2mb”, “最大错误”:“5mb” }, { “类型”:“任何组件样式”, “最大警告”:“6kb”, “最大错误”:“10kb” } ], “输出哈希”:“全部” }, “发展”: { “优化”:错误, “提取许可证”:假, “源地图”:true } }, “默认配置”:“生产” }, “服务”: { “构建器”:“@angular-devkit/build-angular:dev-server”, “选项”:{

      },
      "configurations": {
        "production": {
          
        },
        "development": {
          
        }
      },
      "defaultConfiguration": "development"
    },
    "extract-i18n": {
      "builder": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        
      }
    },
    "test": {
      "builder": "@angular-devkit/build-angular:karma",
      "options": {
        "polyfills": [
          "zone.js",
          "zone.js/testing"
        ],
        "tsConfig": "tsconfig.spec.json",
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "@angular/material/prebuilt-themes/indigo-pink.css",
          "node_modules/bootstrap/dist/css/bootstrap.min.css",
          "src/styles.css"
        ],
        "scripts": ["node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"]
      }
    }
  }
}

} }

我尝试重新安装和更新所有软件包,但没有成功

angular typescript
1个回答
0
投票

您仍在 Angular 16 级别运行某些软件包,请运行以下两个命令并检查您的问题是否已解决。

npm i @angular/cli@latest

npm i @angular/core@latest

另外请尝试升级所有 Angular 包,以便它们全部匹配,如果您需要参考数字,请创建一个虚拟 Angular 项目并获取正确的版本号!

© www.soinside.com 2019 - 2024. All rights reserved.