[英]Cannot find module “cordova/exec” in ionic 2
我正在嘗試使用打字稿開發項目,但為此,我需要使用javascript運行一個庫,該庫的鏈接是https://www.grabba.com/downloads/cordova/plugin 。
當我嘗試使用我的代碼運行該庫時,ionic 2返回上述錯誤。 我每天都在嘗試解決問題,並且已經通過了Google中所有集成javascript和打字稿教程。 有人可以幫我運行這個庫嗎?
我的代碼如下:
瓜爾達 - codigo.ts:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { GrabbaProxcard } from './com.grabba.cordova.plugin/www/grabba';
declare var cordova: any;
/*
Generated class for the GuardaCodigo page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-guarda-codigo',
templateUrl: 'guarda-codigo.html'
})
export class GuardaCodigoPage {
constructor(public nav: NavController) {
function acessaGrabba(value: number){
let proxcard = new GrabbaProxcard();
proxcard.prototype.registerCallback();
}
}
ionViewDidLoad() {
console.log('ionViewDidLoad GuardaCodigoPage');
}
}
瓜爾達 - codigo.html:
<ion-header>
<ion-navbar>
<ion-title>GuardaCodigo</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="registration">
<ion-list>
<ion-item>
<ion-label> Codigo</ion-label>
<ion-input type="text" name = "Codigo"></ion-input>
</ion-item>
</ion-list>
<button ion-button onclick="acessaGrabba(2)">Trigger</button>
</ion-content>
有人可以幫助我,我真的需要解決這個問題。 我將非常感謝。 謝謝您的關注。
在下面關注我的package.json
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",
"@angular/platform-browser": "2.4.8",
"@angular/platform-browser-dynamic": "2.4.8",
"@angular/platform-server": "2.4.8",
"@ionic/storage": "2.0.0",
"cordova": "^6.5.0",
"exec": "^0.2.1",
"ionic-angular": "2.2.0",
"ionic-native": "2.8.1",
"ionicons": "3.0.0",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"zone.js": "0.7.2"
},
"devDependencies": {
"@ionic/app-scripts": "1.1.4",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"com.grabba.cordova.plugin",
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"cordova-sqlite-storage",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "Rollers Monitor: An Ionic project"
}
謝謝您的幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.