我正在将我的应用程序从Angular v13升级到v14,但在运行
在网上搜索时,我发现有几个人和我有同样的问题。 其中一个通过更新他们的custom-webpack包来解决,但我没有使用那个。 另一个是关于安装了错误的@angular/cli版本。但对我来说,那个是正确的。有点类似。
全局安装了@angular/cli@14.2.12,并且在项目的package.json中,我有版本~14.2.12。 它稍微落后于我要升级到的angular版本:14.3.0,但似乎没有14.3.0版本的@angular/cli。
我尝试将Angular的更新降级到版本14.2.12,而不是14.3.0,但问题仍然存在。我还尝试将更新进一步升级到版本15.x.x,其中angular和angular/cli版本相同,但仍然显示关于版本13.0.0的错误。
清除npm缓存或重新克隆存储库也没有解决我的问题。我正在寻找其他建议。
这是我在
ng serve
时遇到了一个错误。This version of CLI is only compatible with Angular versions ^13.0.0 || ^13.3.0-rc.0,
but Angular version 14.3.0 was found instead.
在网上搜索时,我发现有几个人和我有同样的问题。 其中一个通过更新他们的custom-webpack包来解决,但我没有使用那个。 另一个是关于安装了错误的@angular/cli版本。但对我来说,那个是正确的。有点类似。
全局安装了@angular/cli@14.2.12,并且在项目的package.json中,我有版本~14.2.12。 它稍微落后于我要升级到的angular版本:14.3.0,但似乎没有14.3.0版本的@angular/cli。
我尝试将Angular的更新降级到版本14.2.12,而不是14.3.0,但问题仍然存在。我还尝试将更新进一步升级到版本15.x.x,其中angular和angular/cli版本相同,但仍然显示关于版本13.0.0的错误。
清除npm缓存或重新克隆存储库也没有解决我的问题。我正在寻找其他建议。
这是我在
package.json
中的完整依赖列表。"devDependencies": {
"@angular-devkit/architect": "^0.1502.1",
"@angular-devkit/build-angular": "^14.2.12",
"@angular-eslint/builder": "^13.5.0",
"@angular-eslint/eslint-plugin": "^13.5.0",
"@angular-eslint/eslint-plugin-template": "^13.5.0",
"@angular-eslint/schematics": "^13.5.0",
"@angular-eslint/template-parser": "^13.5.0",
"@angular/cli": "~14.2.12",
"@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^14.3.0",
"@babel/core": "^7.22.11",
"@compodoc/compodoc": "^1.1.19",
"@maxxton/build-tools": "^344.0.0",
"@types/jest": "^29.5.4",
"@types/leaflet": "^1.9.4",
"@types/leaflet-draw": "^1.0.8",
"@types/lodash": "4.14.45",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"babel-loader": "^8.2.5",
"eslint": "^8.48.0",
"jest": "^29.6.4",
"jest-preset-angular": "^13.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
},
"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "14.3.0",
"@angular/cdk": "^12.2.13",
"@angular/common": "14.3.0",
"@angular/compiler": "14.3.0",
"@angular/core": "14.3.0",
"@angular/forms": "14.3.0",
"@angular/localize": "^14.3.0",
"@angular/platform-browser": "14.3.0",
"@angular/platform-browser-dynamic": "14.3.0",
"@angular/platform-server": "^14.3.0",
"@angular/router": "14.3.0",
"@maxxton/core": "^8863.0.0",
"@swimlane/ngx-charts": "^19.1.0",
"core-js": "^3.32.1",
"d3": "^7.1.1",
"expr-eval": "^2.0.2",
"firebase": "9.16.0",
"install": "^0.13.0",
"intl": "^1.2.5",
"jest-environment-jsdom": "^29.6.4",
"jszip": "^3.6.0",
"jwt-decode": "^3.1.2",
"keycloak-angular": "^11.0.0",
"keycloak-js": "^16.1.0",
"leaflet": "1.6",
"leaflet-draw": "^1.0.4",
"lodash": "4.17.4",
"mixpanel-browser": "^2.47.0",
"moment": "^2.17.1",
"moment-timezone": "^0.5.21",
"ngx-build-plus": "^13.0.1",
"npm": "^9.8.1",
"rison": "^0.1.1",
"rxjs": "^6.6.7",
"tinymce": "^6.7.0",
"tslib": "^2.6.2",
"xlsx": "^0.15.6",
"zone.js": "~0.11.4"
}
ng version
命令输出什么? - undefined