我將 angular 升級到 angular 13 并且無法構建或服務我的專案。看來 Angular 沒有識別 .html 檔案中的任何我的離子標簽。我錯過了什么?
我能夠運行 npm install 沒有問題。我洗掉了 node_modules 和 package-lock.json 檔案,洗掉了平臺,然后運行 ??npm install 并重新添加了平臺。這是成功的,但是運行 ionic serve 或 ionic cordova build android 會導致一整串錯誤,看起來 angular 沒有看到 ionic html 標簽,并且 Promises 出現新錯誤等等。
我收到很多這樣的錯誤:

這是我運行 Ionic info 時得到的:

我的包.json....
{
"name": "com.xyz.product",
"version": "1.5.1",
"author": "Me",
"homepage": "https://homepage.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/schematics": "^13.2.6",
"@angular/animations": "13.3.0",
"@angular/common": "13.3.0",
"@angular/core": "^13.3.0",
"@angular/forms": "13.3.0",
"@angular/platform-browser": "13.3.0",
"@angular/platform-browser-dynamic": "13.3.0",
"@angular/router": "13.3.0",
"@fortawesome/angular-fontawesome": "^0.10.2",
"@fortawesome/fontawesome-svg-core": "^6.1.0",
"@fortawesome/pro-light-svg-icons": "^6.1.0",
"@ionic-native/app-version": "5.28.0",
"@ionic-native/barcode-scanner": "5.28.0",
"@ionic-native/camera": "5.28.0",
"@ionic-native/core": "5.28.0",
"@ionic-native/device": "5.28.0",
"@ionic-native/file": "5.28.0",
"@ionic-native/file-opener": "5.28.0",
"@ionic-native/file-transfer": "^5.36.0",
"@ionic-native/in-app-browser": "5.28.0",
"@ionic-native/keyboard": "5.28.0",
"@ionic-native/launch-navigator": "5.28.0",
"@ionic-native/network": "5.28.0",
"@ionic-native/splash-screen": "5.28.0",
"@ionic-native/sqlite": "5.28.0",
"@ionic-native/status-bar": "5.28.0",
"@ionic/angular": "^6.0.12",
"@ionic/cordova-builders": "^6.1.0",
"@ionic/storage": "2.3.1",
"angularx-qrcode": "^13.0.3",
"hammerjs": "2.0.8",
"latest-version": "^1.0.1",
"moment": "2.27.0",
"rxjs-compat": "6.5.5",
"signature_pad": "4.0.0",
"tslib": "^2.0.0",
"zone.js": "^0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^13.3.0",
"@angular/cli": "^13.3.0",
"@angular/compiler": "13.3.0",
"@angular/compiler-cli": "13.3.0",
"@angular/language-service": "13.3.0",
"@ionic/angular-toolkit": "^6.1.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "12.11.1",
"codelyzer": "6.0.0",
"cordova-android": "^9.1.0",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-app-version": "^0.1.13",
"cordova-plugin-camera": "^6.0.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-inappbrowser": "5.0.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-network-information": "^3.0.0",
"cordova-plugin-splashscreen": "^6.0.0",
"cordova-plugin-statusbar": "^3.0.0",
"cordova-sqlite-storage": "^6.0.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "^6.3.14",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"phonegap-plugin-barcodescanner": "^8.1.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "^5.12.1",
"typescript": "4.6.2",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^5.0.6"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-file": {},
"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27. "
},
"cordova-plugin-file-transfer": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-network-information": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-sqlite-storage": {},
"phonegap-plugin-barcodescanner": {
"ANDROID_SUPPORT_V4_VERSION": "27. "
},
"cordova-plugin-actionsheet": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27. ",
"ANDROIDX_CORE_VERSION": "1.6. "
},
"cordova-plugin-app-version": {}
},
"platforms": [
"android"
]
}
}
uj5u.com熱心網友回復:
弄清楚問題出在哪里。MicrosoftSDK 在運行“where tsc”時具有 TypeScript 3.1 和第一個。我在環境變數中向上移動了 npm 目錄。然后我洗掉了 Angular 并重新安裝了它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/450284.html
