Ionic 4发行后,Ionic 3错误安装本机插件

Fra*_*rew 3 ionic-framework cordova-plugins

安装Native Store成功后,使用本地插件ionic 3出现问题,但是当我尝试添加应用模块时,文本编辑器显示红线,而当我尝试运行时,发现了如下错误。我在这里安装本机商店(https://ionicframework.com/docs/v3/native/native-storage/

文本编辑器中的红线,安装成功,但是在应用模块中添加时显示红线。 在此处输入图片说明

在此处输入图片说明

当运行“ 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
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题。

谢谢。

Kru*_*ela 5

尝试查找..倒数第二个上一个以前的版本,并在添加插件时附加

npm install @ionic-native/native-storage@4.19.0
Run Code Online (Sandbox Code Playgroud)

此处...最新版本为5.0.0,因此请添加@ 4.19.0,请不要基于
数字进行假设进入Repo或npm链接,尝试找到我们的先前版本,然后附加。

然后定期执行所有步骤。

谢谢


gio*_*pds 5

@ionic-native现在/ngx,您的所有模块最终都将用于Angular项目。像这样修复它:

import { NativeStorage } from '@ionic-native/native-storage/ngx';
Run Code Online (Sandbox Code Playgroud)

将此应用到每个@ionic-native插件/模块。