cordova – 模块没有导出成员’IonicNativePlugin’,Ionic2

发布时间:2020-10-13 发布网站:编程之家
编程之家收集整理的这篇文章主要介绍了cordova – 模块没有导出成员’IonicNativePlugin’,Ionic2编程之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图让相机,文件,文件路径和传输插件工作,我收到这些错误,

Module 'node_modules/@ionic-native/core/index' has no exported member 'IonicNativePlugin'

我得到了最新的Ionic2版本.

package.json文件按要求

"dependencies": {
"@angular/common": "4.0.0","@angular/compiler": "4.0.0","@angular/compiler-cli": "4.0.0","@angular/core": "4.0.0","@angular/forms": "4.0.0","@angular/http": "4.0.0","@angular/platform-browser": "4.0.0","@angular/platform-browser-dynamic": "4.0.0","@ionic-native/camera": "^3.6.0","@ionic-native/core": "3.4.2","@ionic-native/file": "^3.6.0","@ionic-native/file-path": "^3.6.0","@ionic-native/splash-screen": "3.4.2","@ionic-native/status-bar": "3.4.2","@ionic-native/transfer": "^3.6.0","@ionic/storage": "2.0.1","crypto-js": "3.1.9-1","fast-sha256": "1.0.0","ionic-angular": "3.0.1","ionic-native": "^3.5.0","ionicons": "3.0.0","rxjs": "5.1.1","sha256": "0.2.0","sw-toolbox": "3.4.0","ts-md5": "1.2.0","zone.js": "^0.8.4"

devDependencies": {
    "@ionic/app-scripts": "1.3.0","typescript": "~2.2.1"

"cordovaPlugins": [
    "cordova-plugin-whitelist","cordova-plugin-console","cordova-plugin-statusbar","cordova-plugin-device","ionic-plugin-keyboard","cordova-plugin-splashscreen"

"cordovaPlatforms": [],"description": "Work: An Ionic project"

我错过了什么吗?

解决方法

IonicNativePlugin适用于ionic-native / core最新版本(3.6.1),因此您必须更新到最新版本.

在项目目录中键入以下命令:

npm install @ionic-native/core --save

问题解决了.

总结

以上是编程之家为你收集整理的cordova – 模块没有导出成员’IonicNativePlugin’,Ionic2全部内容,希望文章能够帮你解决cordova – 模块没有导出成员’IonicNativePlugin’,Ionic2所遇到的程序开发问题。

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您喜欢交流学习经验,点击链接加入编程之家官方QQ群:1065694478
编程之家官方公众号

微信公众号搜索 “ 程序精选 ” ,选择关注!

微信公众号搜索 “ 程序精选 ”
精选程序员所需精品干货内容!