uport-project / ethr-did

Create ethr DIDs
Apache License 2.0
259 stars 52 forks source link

[BUG] Simple code not working #92

Closed tnkhanh closed 2 years ago

tnkhanh commented 2 years ago

Hi, I'm just testing out ethr-did but the most simple code doesn't work for me:

const EthrDID = require("ethr-did");
const keypair = EthrDID.createKeyPair();

It gives me

TypeError: EthrDID.createKeyPair is not a function

I have Node 16.15 , npm8.5.5 and ethr-did 2.2.2

mirceanis commented 2 years ago

Try const { EthrDID } = require("ethr-did"); instead. Or import { EthrDID} from 'ethr-did' as it says in the Readme

tnkhanh commented 2 years ago

Thanks! That works!