Ionic 4 发布后,Ionic 3 错误安装本机插件 [英] Ionic 3 error install native plugin after Ionic 4 release

查看:25
本文介绍了Ionic 4 发布后,Ionic 3 错误安装本机插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当安装 Native Store 成功时,我在使用原生插件 ionic 3 时遇到问题,但是当我尝试添加应用模块时,文本编辑器显示一条红线,当我尝试运行时,我发现了如下错误.这里我安装 Native-store (

这是运行'ionic cordova run android'时控制台中的错误.

[14:40:05] ionic-app-scripts 3.1.8[14:40:05] 构建开发开始......[14:40:05] 清洁开始...[14:40:05] 清理在 71 毫秒内完成[14:40:05] 复制开始...[14:40:07] 深层链接开始......[14:40:08] 深度链接在 1.04 秒内完成[14:40:08] 转译开始......[14:40:27] 打字稿:D:/myProject/ionic/myApp/src/app/app.module.ts,第 57 行'{ 类型的参数声明:(typeof VerificationPage | typeof LoginPage | typeof PrivacyRegisterPage |typeof...' 不能分配给类型为 'NgModule' 的参数.财产提供者"的类型是不相容.类型'(启动画面的类型 | FCM 的类型 | 应用程序浏览器的类型 | AppVersion 的类型 | 类型的市场 |typ...' 不能分配给类型 'Provider[]'.输入'typeof SplashScreen |FCM类型|类型应用程序浏览器 |应用版本类型 |市场类型|type...' 不能分配给类型 'Provider'.类型NativeStorageOriginal"不可分配给Provider"类型.类型NativeStorageOriginal"不可分配输入ClassProvider".NativeStorageOriginal"类型中缺少provide"属性.[14:40:27] 离子应用脚本任务:构建"[14:40:27] 错误:无法编译程序错误:无法编译程序在新的 BuildError (D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdistutilerrors.js:16:28)在 D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdist	ranspile.js:159:20在承诺(<匿名>)在 transpileWorker (D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdist	ranspile.js:107:12)在 Object.transpile (D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdist	ranspile.js:64:12)在 D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdistuild.js:109:82在<匿名>[错误] 找不到命令:ionic-app-scripts

请帮我解决这个问题.

谢谢.

解决方案

Try To Find .. Second Last Previous Version of Plugin &添加插件时追加

npm install @ionic-native/native-storage@4.19.0

这里...最新版本是 5.0.0 所以添加@4.19.0 请不要基于此做出假设
Number Go In Repo 或 npm 链接尝试找到我们以前的版本然后追加.

然后定期执行所有步骤.

谢谢

I get a problem using native plugin ionic 3 when install Native Store is success, but when I try to add in app module, the text editor show a red line and when I try to run I found an error like below. Here I install Native-store (https://ionicframework.com/docs/v3/native/native-storage/)

Red line in text editor, successful install but when add in app module show red line.

This is error in console when run 'ionic cordova run android'.

[14:40:05]  ionic-app-scripts 3.1.8
[14:40:05]  build dev started ...
[14:40:05]  clean started ...
[14:40:05]  clean finished in 71 ms
[14:40:05]  copy started ...
[14:40:07]  deeplinks started ...
[14:40:08]  deeplinks finished in 1.04 s
[14:40:08]  transpile started ...
[14:40:27]  typescript: D:/myProject/ionic/myApp/src/app/app.module.ts, line: 57
            Argument of type '{ declarations: (typeof VerificationPage | typeof LoginPage | typeof PrivacyRegisterPage |
            typeof...' is not assignable to parameter of type 'NgModule'. Types of property 'providers' are
            incompatible. Type '(typeof SplashScreen | typeof FCM | typeof InAppBrowser | typeof AppVersion | typeof
            Market | typ...' is not assignable to type 'Provider[]'. Type 'typeof SplashScreen | typeof FCM | typeof
            InAppBrowser | typeof AppVersion | typeof Market | type...' is not assignable to type 'Provider'. Type
            'NativeStorageOriginal' is not assignable to type 'Provider'. Type 'NativeStorageOriginal' is not assignable
            to type 'ClassProvider'. Property 'provide' is missing in type 'NativeStorageOriginal'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
[14:40:27]  ionic-app-script task: "build"
[14:40:27]  Error: Failed to transpile program
Error: Failed to transpile program
    at new BuildError (D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdistutilerrors.js:16:28)
    at D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdist	ranspile.js:159:20
    at Promise (<anonymous>)
    at transpileWorker (D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdist	ranspile.js:107:12)
    at Object.transpile (D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdist	ranspile.js:64:12)
    at D:myProjectionicmyApp
ode_modules@ionicapp-scriptsdistuild.js:109:82
    at <anonymous>
[ERROR] Command not found: ionic-app-scripts

Please help me to solve this problem.

Thanks.

解决方案

Try To Find .. Second Last Previous Version of Plugin & Append While Adding Plugin

npm install @ionic-native/native-storage@4.19.0

Here... Latest Version is 5.0.0 So Add @4.19.0 Please Don't Make Assumption Based On
Number Go In Repo or npm link try to find our previous version then append.

Then do your All Step Regularly.

Thanks

这篇关于Ionic 4 发布后,Ionic 3 错误安装本机插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆