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