Woocommerce rest api node_modules中的错误

时间:2019-03-06 17:56:59

标签: angularjs typescript ionic-framework angular5 woocommerce-rest-api

当我连接到woocommerce rest api时,我在ionic 3中收到一个node_modules错误,我得到了这种错误,如图you can see the error in the image and the code also by clicking on this link

所示。

此代码为ionic页面,此处与woocommerce rest-api连接,所以我不知道如何解决此错误,请帮帮我!

import { Component } from '@angular/core';

import * as WC from 'woocommerce-api';

import { NavController } from '../../../node_modules/@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  WooCommerce: any;
  products: any[];


constructor(public navCtrl: NavController){

  this.WooCommerce= WC({
  url: "http://localhost/wordpress/",
  consumerKey: "ck_cd2dcded35f17a63f98ea4a636da8df9e8d5ea67",
  consumerSecret: "cs_66606fe482ecc62cdc8656d79467afa011bcf332",

});

this.WooCommerce.getAsync("products").then( (data) => {
  console.log(data);
},(err)=> {
   console.log(err)
}) 
}

}

0 个答案:

没有答案