angular - Angular 服务失败
问题描述
我正在使用 Angular 和 NX 工作区开发 Web。它是以下环境,应用程序是在 nx 工作区上创建的。但是,如果您保留该应用程序,则会连续出现以下错误。我在这里搜索并重新安装了@angular-devkit/build-kit,但结果是一样的。我该如何解决这个问题?
*错误
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(outputPath)
*环境
节点版本 = v10.15.3
Angular CLI: 9.1.7
Node: 10.15.3
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.901.7
@angular-devkit/build-angular 0.901.7
@angular-devkit/build-optimizer 0.901.7
@angular-devkit/build-webpack 0.901.6
@angular-devkit/core 9.1.7
@angular-devkit/schematics 9.1.6
@angular/cli 9.1.7
@angular/http 7.2.16
@ngtools/webpack 9.1.7
@schematics/angular 9.1.6
@schematics/update 0.901.7
rxjs 6.5.5
typescript 3.9.3
webpack 4.42.0
我的 angular.json 在这里。
{
"version": 1,
"projects": {
"testbed": {
"projectType": "application",
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
},
"root": "apps/testbed",
"sourceRoot": "apps/testbed/src",
"prefix": "stela-fes",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/testbed",
"index": "apps/testbed/src/index.html",
"main": "apps/testbed/src/main.ts",
"polyfills": "apps/testbed/src/polyfills.ts",
"tsConfig": "apps/testbed/tsconfig.app.json",
"aot": true,
"assets": [
"apps/testbed/src/favicon.ico",
"apps/testbed/src/assets"
],
"styles": ["apps/testbed/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/testbed/src/environments/environment.ts",
"with": "apps/testbed/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"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": "testbed:build"
},
"configurations": {
"production": {
"browserTarget": "testbed:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "testbed:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/testbed/tsconfig.app.json",
"apps/testbed/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!apps/testbed/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/testbed/jest.config.js",
"tsConfig": "apps/testbed/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "apps/testbed/src/test-setup.ts"
}
}
}
},
"testbed-e2e": {
"root": "apps/testbed-e2e",
"sourceRoot": "apps/testbed-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/testbed-e2e/cypress.json",
"tsConfig": "apps/testbed-e2e/tsconfig.e2e.json",
"devServerTarget": "testbed:serve"
},
"configurations": {
"production": {
"devServerTarget": "testbed:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["apps/testbed-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/testbed-e2e/**"]
}
}
}
},
"login-proc": {
"projectType": "library",
"root": "libs/login-proc",
"sourceRoot": "libs/login-proc/src",
"prefix": "stela-fes",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/login-proc/tsconfig.lib.json",
"libs/login-proc/tsconfig.spec.json"
],
"assets": [
{
"glob": "**/*",
"input": "./libs/assets/",
"output": "./assets"
}
],
"exclude": ["**/node_modules/**", "!libs/login-proc/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/login-proc/jest.config.js",
"tsConfig": "libs/login-proc/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/login-proc/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
}
},
"stim_testspec_mgr": {
"projectType": "application",
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
},
"root": "apps/stim_testspec_mgr",
"sourceRoot": "apps/stim_testspec_mgr/src",
"prefix": "stela-fes",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/stim_testspec_mgr",
"index": "apps/stim_testspec_mgr/src/index.html",
"main": "apps/stim_testspec_mgr/src/main.ts",
"polyfills": "apps/stim_testspec_mgr/src/polyfills.ts",
"tsConfig": "apps/stim_testspec_mgr/tsconfig.app.json",
"aot": true,
"assets": [
"apps/stim_testspec_mgr/src/favicon.ico",
"apps/stim_testspec_mgr/src/assets",
{
"glob": "**/*",
"input": "./libs/assets/",
"output": "./assets"
}
],
"styles": ["apps/stim_testspec_mgr/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/stim_testspec_mgr/src/environments/environment.ts",
"with": "apps/stim_testspec_mgr/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"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": "stim_testspec_mgr:build",
"outputPath": "dist/stim_testspec_mgr",
"main": "src/main.server.ts",
"tsConfig": "src/tsconfig.server.json"
},
"configurations": {
"production": {
"browserTarget": "stim_testspec_mgr:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "stim_testspec_mgr:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/stim_testspec_mgr/tsconfig.app.json",
"apps/stim_testspec_mgr/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!apps/stim_testspec_mgr/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/stim_testspec_mgr/jest.config.js",
"tsConfig": "apps/stim_testspec_mgr/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "apps/stim_testspec_mgr/src/test-setup.ts"
}
}
}
},
"stela-svc": {
"projectType": "library",
"root": "libs/stela-svc",
"sourceRoot": "libs/stela-svc/src",
"prefix": "stela-fes",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/stela-svc/tsconfig.lib.json",
"libs/stela-svc/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!libs/stela-svc/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/stela-svc/jest.config.js",
"tsConfig": "libs/stela-svc/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/stela-svc/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
}
},
"stela-app": {
"projectType": "library",
"root": "libs/stela-app",
"sourceRoot": "libs/stela-app/src",
"prefix": "stela-fes",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/stela-app/tsconfig.lib.json",
"libs/stela-app/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!libs/stela-app/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/stela-app/jest.config.js",
"tsConfig": "libs/stela-app/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/stela-app/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
}
}
},
"cli": {
"defaultCollection": "@nrwl/angular"
},
"schematics": {
"@nrwl/angular:application": {
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"unitTestRunner": "jest"
}
},
"defaultProject": "testbed"
}
解决方案
首先做:
npm update
之后,更新 Angular 依赖项
ng update
最后更新任何不匹配的依赖项
ng update --all --force
让我知道它是否成功了
推荐阅读
- ios - 在 MainView 上隐藏 StatusBar 和 NavigationBar 但在 Swift 的 DetailView 上显示它
- c++ - 如何解析包含 unicode 文字的 std::string?
- python - Anaconda 导航器打开虚拟环境 jupyter
- php - 从列相同的 2 个表中选择数据,查询不太正确?
- html - chartjs tooltip html:使用数据填充工具提示
- swift - 以卡片形式呈现时核心数据未保存
- java - 替换所有匹配给定模式的匹配项
- python - 熊猫:从另一列的子集字典创建列
- sql - Snowflake 在显示结果时自动压缩位于字符串中间的多个连续空格
- ubuntu-20.04 - 错误:在 ubuntu 20.04 上的 imc 0 上禁用了 edac skx ecc