无法安装ionic2 SQLite插件

时间:2022-12-07 23:03:50

I work on Window, with MINGW64 bash. I create an Ionic 2 project and add the SQLite plugin with the following line :

我在windows上工作,使用MINGW64 bash。我创建了一个Ionic 2项目,并添加了SQLite插件,如下所示:

$ ionic plugin add cordova-sqlite-storage

When I run my project, with : $ ionic serve --lab

当我运行我的项目时,用:$ ionic serve——lab

My project start and is displayed on Firefox, but in my console I have the following line :

我的项目启动并显示在Firefox上,但在我的控制台中,我有以下一行:

Native: tried accessing the SQLite plugin but it's not installed.    main.js
Install the SQLite plugin: 'ionic plugin add cordova-sqlite-storage' main.js

But I don't have a "main.js" file in my project, I have only a main.ts file which contain :

但我没有“主”。在我的项目中,我只有一个主文件。ts文件包含:

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app.module';

platformBrowserDynamic().bootstrapModule(AppModule);

Does the plugins can be run on the emulate device on the web browser ?

插件可以在web浏览器的仿真设备上运行吗?

1 个解决方案

#1


1  

The plugins don't get loaded in ionic serve as @suraj pointed out. Try running it in the browser platform.

插件不会像@suraj指出的那样在ionic服务中加载。尝试在浏览器平台上运行它。

ionic platform add browser

离子平台添加浏览器

ionic run browser

离子运行浏览器

#1


1  

The plugins don't get loaded in ionic serve as @suraj pointed out. Try running it in the browser platform.

插件不会像@suraj指出的那样在ionic服务中加载。尝试在浏览器平台上运行它。

ionic platform add browser

离子平台添加浏览器

ionic run browser

离子运行浏览器