当我执行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-browser”:“^5.2.11”、“@angular/platform-browser-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" }