0

当我执行ionic serve,我有这个错误:

[app-scripts] [15:04:28] transpile 开始... [app-scripts] [15:04:42] typescript: ...aceIcaro_5_3B/dev-app/app/node_modules/@ionic-native/core /decorators/common.d.ts,行:10 [app-scripts] 找不到名称“未知”。[app-scripts] L9: 导出声明函数 wrapPromise(pluginObj: any, methodName: string, args: any[], opts?: CordovaOptions): Promise; [app-scripts] L11: * 检查插件/cordova 是否可用

我已经读过,如果我在 @ionic-native/core/decorators 的 common.d.ts 第 10 行更改 unknown ,错误就会消失。这是真的,但我想知道原因。

我在 package.json 的依赖项是:

“依赖”:{“@angular/animations”:“^5.2.11”,“@angular/common”:“^5.2.11”,“@angular/compiler”:“^5.2.11”,“@angular /compiler-cli": "^5.2.11", "@angular/core": "^5.2.11", "@angular/forms": "^5.2.11", "@angular/http": "^ 5.2.11”、“@angular/platform-b​​rowser”:“^5.2.11”、“@angular/platform-b​​rowser-dynamic”:“^5.2.11”、“@angular/router”:“^5.2. 11”、“@auth0/angular-jwt”:“^1.2.0”、“@ionic-native/app-version”:“5.14.0”、“@ionic-native/core”:“5.14.0” , "@ionic-native/date-picker": "5.14.0", "@ionic-native/file": "^5.14.0", "@ionic-native/file-opener": "^5.14.0", "@ionic-native/globalization": "5.14.0 ", "@ionic-native/in-app-browser": "5.14.0", "@ionic-native/ionic-webview": "5.14.0", "@ionic-native/splash-screen": " 5.14.0”、“@ionic-native/status-bar”:“5.14.0”、“@ionic/storage”:“2.2.0”、“@ngx-translate/core”:“^9.1.1” ,“@ngx-translate/http-loader”:“^2.0.1”,“@types/lodash”:“4.14.118”,“cordova”:“^9.0.0”,“cordova-android”:“ 8.1.0", "cordova 浏览器": "6.0.0",“cordova-ios”:“5.0.1”、“cordova-plugin-app-version”:“^0.1.9”、“cordova-plugin-datepicker”:“^0.9.3”、“cordova-plugin-device” ": "^2.0.3", "cordova-plugin-file": "^6.0.2", "cordova-plugin-file-opener2": "^2.2.1", "cordova-plugin-globalization": " ^1.11.0”、“cordova-plugin-inappbrowser”:“^3.1.0”、“cordova-plugin-ionic-keyboard”:“^2.2.0”、“cordova-plugin-ionic-webview”:“^ 4.1.2", "cordova-plugin-splashscreen": "^5.0.3", "cordova-plugin-statusbar": "git+^0.1.9”、“cordova-plugin-datepicker”:“^0.9.3”、“cordova-plugin-device”:“^2.0.3”、“cordova-plugin-file”:“^6.0.2” , "cordova-plugin-file-opener2": "^2.2.1", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-inappbrowser": "^3.1.0", "cordova -plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^4.1.2", "cordova-plugin-splashscreen": "^5.0.3", "cordova-插件状态栏": "git+^0.1.9”、“cordova-plugin-datepicker”:“^0.9.3”、“cordova-plugin-device”:“^2.0.3”、“cordova-plugin-file”:“^6.0.2” , "cordova-plugin-file-opener2": "^2.2.1", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-inappbrowser": "^3.1.0", "cordova -plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^4.1.2", "cordova-plugin-splashscreen": "^5.0.3", "cordova-插件状态栏": "git+“cordova-plugin-file-opener2”:“^2.2.1”、“cordova-plugin-globalization”:“^1.11.0”、“cordova-plugin-inappbrowser”:“^3.1.0”、“cordova-插件离子键盘”:“^2.2.0”,“cordova-plugin-ionic-webview”:“^4.1.2”,“cordova-plugin-splashscreen”:“^5.0.3”,“cordova-plugin” -状态栏”:“git +“cordova-plugin-file-opener2”:“^2.2.1”、“cordova-plugin-globalization”:“^1.11.0”、“cordova-plugin-inappbrowser”:“^3.1.0”、“cordova-插件离子键盘”:“^2.2.0”,“cordova-plugin-ionic-webview”:“^4.1.2”,“cordova-plugin-splashscreen”:“^5.0.3”,“cordova-plugin” -状态栏”:“git +3", "cordova-plugin-statusbar": "git+3", "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git ", "cordova-plugin-whitelist": "^1.3.4", "ionic-angular": "^3.9.8", "ionic-工具提示”:“^2.1.1”、“ionic2-super-tabs”:“^4.3.1”、“ionicons”:“^3.0.0”、“jwt-decode”:“^2.2.0”、“ lodash”:“4.17.11”,“时刻”:“^2.24.0”,“ngx-permissions”:“^4.1.0”,“node-sass”:“^4.11.0”,“运行”: “1.4.0”、“rxjs”:“^5.5.12”、“sw-toolbox”:“3.6.0”、“zone.js”:“0.8.26”}、“devDependencies”:{“@ionic/app-scripts": "^3.2.2", "@ionic/lab": "1.0.6", "typescript": "2.8.3" }

4

1 回答 1

0

我找到了解决方案。我进行了这些更改,因为在以 iOS13 作为操作系统的设备中,我无法可视化本机日历和时钟。

所以我可以说我有两个解决方案。

日历和时钟的问题是由于新的暗模式,所以我强制 iOS 设备在我的应用程序中使用亮模式。

依赖关系的问题更复杂。我回到了以前的版本,所以一切正常。如果我想更新我的依赖,我必须将“ionic-angular”替换为“@ionic/angular”,更新打字稿,所有@angular/* 的东西都需要加入@angular/core 和“ionic2-super-tabs”可以产生问题。所以最好生成一个新项目并迁移我的代码。

于 2019-10-09T08:23:49.543 回答