1

I want to generate Mnemonic for creating an account, I was using the following code and I got the error as

TypeError: Cannot read property 'entropyToMnemonic' of undefined

I am sure I am missing something

> var ethers = require('ethers')
undefined
> const mnemonic = 
ethers.HDNode.entropyToMnemonic(ethers.utils.randomBytes(16))
1

I think you need the utils in there:

ethers.utils.HDNode.entropyToMnemonic()

(i.e. It's in the utils/hdnode.js file.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.