Ionic 3:输入'any'不是构造函数类型(Ionic 3 :Type 'any' is not a constructor function type)

编程入门 行业动态 更新时间:2024-10-23 18:27:29
Ionic 3:输入'any'不是构造函数类型(Ionic 3 :Type 'any' is not a constructor function type)

当我处理并移动到具有离子3的mac时,我在我的linux任务中有了我的离子2项目。

所以我创建了一个新项目,并替换了页面,提供了与新项目组件文件夹,我得到的错误就像cannot find module "ionic-native"后导入我的插件到app.modulte.ts文件我越来越像错误'输入'any'不是一个构造函数类型.`

我的终端显示

17:39:48] typescript: node_modules/@ionic-native/app-version/index.d.ts, line: 25 Type 'any' is not a constructor function type. [17:39:48] typescript: node_modules/@ionic-native/geolocation/index.d.ts, line: 127 [17:39:48] typescript: node_modules/@ionic-native/google-analytics/index.d.ts, line: 30 [17:39:48] typescript: node_modules/@ionic-native/network/index.d.ts, line: 49 [17:39:48] typescript: node_modules/@ionic-native/sms/index.d.ts, line: 41 [17:39:48] typescript: node_modules/@ionic-native/social-sharing/index.d.ts, line: 29 [17:39:48] typescript: node_modules/@ionic-native/sqlite/index.d.ts, line: 115 L25: export declare class AppVersion extends IonicNativePlugin { Type 'any' is not a constructor function type. L127: export declare class Geolocation extends IonicNativePlugin { Type 'any' is not a constructor function type. L30: export declare class GoogleAnalytics extends IonicNativePlugin { Type 'any' is not a constructor function type. L49: export declare class Network extends IonicNativePlugin { Type 'any' is not a constructor function type. L41: export declare class SMS extends IonicNativePlugin { Type 'any' is not a constructor function type. L29: export declare class SocialSharing extends IonicNativePlugin { Type 'any' is not a constructor function type. L115: export declare class SQLite extends IonicNativePlugin { [17:39:48] dev server running: http://localhost:8100/

在我的浏览器中,我收到错误信息

这里是我的package.json文件

{ "name": "ionic-hello-world", "version": "0.0.0", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular/common": "4.0.2", "@angular/compiler": "4.0.2", "@angular/compiler-cli": "4.0.2", "@angular/core": "4.0.2", "@angular/forms": "4.0.2", "@angular/http": "4.0.2", "@angular/platform-browser": "4.0.2", "@angular/platform-browser-dynamic": "4.0.2", "@ionic-native/app-version": "^3.6.1", "@ionic-native/geolocation": "^3.6.1", "@ionic-native/google-analytics": "^3.6.1", "@ionic-native/network": "^3.6.1", "@ionic-native/sms": "^3.6.1", "@ionic-native/social-sharing": "^3.6.1", "@ionic-native/splash-screen": "3.4.2", "@ionic-native/sqlite": "^3.6.1", "@ionic-native/status-bar": "3.4.2", "@ionic/storage": "2.0.1", "ionic-angular": "3.1.1", "ionicons": "3.0.0", "rxjs": "5.1.1", "sw-toolbox": "3.4.0", "zone.js": "^0.8.5" }, "devDependencies": { "@ionic/app-scripts": "1.3.6", "typescript": "~2.2.1" }, "cordovaPlugins": [ "cordova-plugin-whitelist", "cordova-plugin-statusbar", "cordova-plugin-console", "cordova-plugin-device", "cordova-plugin-splashscreen", "ionic-plugin-keyboard", "cordova-plugin-android-permissions", "cordova-plugin-app-version", "cordova-plugin-geolocation", "cordova-plugin-google-analytics", "cordova-plugin-network-information", "cordova-plugin-sms", "cordova-plugin-x-socialsharing", "cordova-sqlite-storage" ], "cordovaPlatforms": [ "ios", { "platform": "ios", "version": "", "locator": "ios" } ], "description": "kmart: An Ionic project" }

在使用npm install @ionic-native/core --save错误信息

I had my ionic 2 project in my linux mission when i coped and moved to the mac which has ionic 3.

So i created a new project and replaced the pages, provides, components folder with the new project i was getting error like cannot find module "ionic-native" after importing my plugins into app.modulte.ts file i am getting as error as 'Type 'any' is not a constructor function type.`

my terminal shows

17:39:48] typescript: node_modules/@ionic-native/app-version/index.d.ts, line: 25 Type 'any' is not a constructor function type. [17:39:48] typescript: node_modules/@ionic-native/geolocation/index.d.ts, line: 127 [17:39:48] typescript: node_modules/@ionic-native/google-analytics/index.d.ts, line: 30 [17:39:48] typescript: node_modules/@ionic-native/network/index.d.ts, line: 49 [17:39:48] typescript: node_modules/@ionic-native/sms/index.d.ts, line: 41 [17:39:48] typescript: node_modules/@ionic-native/social-sharing/index.d.ts, line: 29 [17:39:48] typescript: node_modules/@ionic-native/sqlite/index.d.ts, line: 115 L25: export declare class AppVersion extends IonicNativePlugin { Type 'any' is not a constructor function type. L127: export declare class Geolocation extends IonicNativePlugin { Type 'any' is not a constructor function type. L30: export declare class GoogleAnalytics extends IonicNativePlugin { Type 'any' is not a constructor function type. L49: export declare class Network extends IonicNativePlugin { Type 'any' is not a constructor function type. L41: export declare class SMS extends IonicNativePlugin { Type 'any' is not a constructor function type. L29: export declare class SocialSharing extends IonicNativePlugin { Type 'any' is not a constructor function type. L115: export declare class SQLite extends IonicNativePlugin { [17:39:48] dev server running: http://localhost:8100/

in my browser i am getting error like

here is my package.json file

{ "name": "ionic-hello-world", "version": "0.0.0", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular/common": "4.0.2", "@angular/compiler": "4.0.2", "@angular/compiler-cli": "4.0.2", "@angular/core": "4.0.2", "@angular/forms": "4.0.2", "@angular/http": "4.0.2", "@angular/platform-browser": "4.0.2", "@angular/platform-browser-dynamic": "4.0.2", "@ionic-native/app-version": "^3.6.1", "@ionic-native/geolocation": "^3.6.1", "@ionic-native/google-analytics": "^3.6.1", "@ionic-native/network": "^3.6.1", "@ionic-native/sms": "^3.6.1", "@ionic-native/social-sharing": "^3.6.1", "@ionic-native/splash-screen": "3.4.2", "@ionic-native/sqlite": "^3.6.1", "@ionic-native/status-bar": "3.4.2", "@ionic/storage": "2.0.1", "ionic-angular": "3.1.1", "ionicons": "3.0.0", "rxjs": "5.1.1", "sw-toolbox": "3.4.0", "zone.js": "^0.8.5" }, "devDependencies": { "@ionic/app-scripts": "1.3.6", "typescript": "~2.2.1" }, "cordovaPlugins": [ "cordova-plugin-whitelist", "cordova-plugin-statusbar", "cordova-plugin-console", "cordova-plugin-device", "cordova-plugin-splashscreen", "ionic-plugin-keyboard", "cordova-plugin-android-permissions", "cordova-plugin-app-version", "cordova-plugin-geolocation", "cordova-plugin-google-analytics", "cordova-plugin-network-information", "cordova-plugin-sms", "cordova-plugin-x-socialsharing", "cordova-sqlite-storage" ], "cordovaPlatforms": [ "ios", { "platform": "ios", "version": "", "locator": "ios" } ], "description": "kmart: An Ionic project" }

after using npm install @ionic-native/core --save i am getting error like

最满意答案

要使用ionic-native 3.x,您需要安装@ionic-native/core 。

npm install @ionic-native/core@3.6.1 --save

To use ionic-native 3.x you need to install @ionic-native/core.

npm install @ionic-native/core@3.6.1 --save

更多推荐

本文发布于:2023-04-28 03:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329804.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   类型   Ionic   Type   type

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!