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

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

问题描述

当成功安装Native Store时,我使用本机插件ionic 3遇到问题,但是当我尝试在应用模块中添加时,文本编辑器显示红线,而当我尝试运行时,发现了如下错误。我在这里安装本机存储(





在运行 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类型的参数。属性提供者的类型不兼容
。类型'((typeof SplashScreen | typeof FCM | typeof InAppBrowser | typeof AppVersion | typeof
市场| typ ...'不能分配给类型'Provider []'。类型'typeof SplashScreen | typeof FCM | typeof
InAppBrowser | typeof AppVersion | typeof市场| type ...'不能分配给类型'Provider'。类型
'NativeStorageOriginal'不能分配给类型'Provider'。类型'NativeStorageOriginal'不能分配
键入 ClassProvider,在 NativeStorageOriginal类型中缺少属性 provide。
[14:40:27] ionic-app-script任务:构建
[14:40:27]错误:无法编译程序
错误:未能编译程序
在新的BuildError上(D:\myProject\ionic\myApp\node_modules\@ionic-app-scripts\dist\util\errors.js:16:28)
在D:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:159:20
在Promise(< anonymous>)
在transpileWorker(D:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:107:12)
在Object.transpile(D :\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:64:12)
在D:\myProject\ionic\ myApp\node_modules\ @ ionic\app脚本\dist\build.js:109:82
at< anony慕斯
[错误]找不到命令:ionic-app-scripts

请帮助我解决



谢谢。

解决方案

尝试查找..插件&的倒数第二个以前的版本在添加插件时追加

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

此处...最新版本为5.0.0,所以请添加@ 4.19.0,请不要基于
$ b进行假设$ b Number进入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:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at D:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:159:20
    at Promise (<anonymous>)
    at transpileWorker (D:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:107:12)
    at Object.transpile (D:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:64:12)
    at D:\myProject\ionic\myApp\node_modules\@ionic\app-scripts\dist\build.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天全站免登陆