1
我导入在angular4 ethereumjs-wallet的函数,crypto.randomBytes不在角
import EthereumWallet from 'ethereumjs-wallet';
var wallet = EthereumWallet.generate();
const jsV3 = wallet.toV3(passwd);
示出为下面
var privKey = crypto.randomBytes(32)
引发出一个错误
库中的代码ERROR Error: Uncaught (in promise): TypeError: crypto.randomBytes is not a function TypeError: crypto.randomBytes is not a function TypeError: crypto.randomBytes is not a function at Function.webpackJsonp.../../../../ethereumjs-wallet/index.js.Wallet.generate
如何解决?
代表你有多少代表,你会知道如何提出问题。一行代码对诊断问题并不是很有用:) – Alex
我已经更新了这个问题 – user824624