我正在尝试创建一个使用Ionic的电子钱包应用程序。我已经尝试导入bip39节点模块直接在角度项目,但它给了我错误。请帮帮忙
import { Injectable } from '@angular/core';
import * as bip39 from 'bip39';
@Injectable({
providedIn: 'root'
})
export class EthereumService {
mnemonic = 'hello world';
constructor() {
this.mnemonic = bip39.generateMnemonic();
}
}错误:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'prototype' of undefined
TypeError: Cannot read property 'prototype' of undefined
at inherits (inherits_browser.js:5)
at Object../node_modules/hash-base/index.js (index.js:23)
at __webpack_require__ (bootstrap:83)
at Object../node_modules/md5.js/index.js (index.js:3)
at __webpack_require__ (bootstrap:83)
at Object../node_modules/create-hash/browser.js (browser.js:3)
at __webpack_require__ (bootstrap:83)
at Object../node_modules/bip39/src/index.js (index.js:3)
at __webpack_require__ (bootstrap:83)
at Module../src/app/ethereum.service.ts (signup.page.ts:15)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)发布于 2019-08-03 04:14:38
import Bip39 from 'bip39';https://github.com/mottolini/ionic-ethereum/blob/master/src/providers/ethereum/ethereum.ts
确认你的密码!
https://ethereum.stackexchange.com/questions/71812
复制相似问题