-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECPairFactory is not a function #3
Comments
Did you |
Yes, both: npm install bitcoinjs-lib |
Which script did you try to run? What does |
Ubuntu Server 18 running in Win10 ` TypeError: require(...).ECPairFactory is not a function |
i cant reproduce this (archlinux) what does what version op $ cat node_modules/ecpair/package.json | grep version
"version": "2.0.1", |
I'm getting { |
cat node_modules/ecpair/package.json | grep version |
looks like a really old version of bitcoinjs lib and ecpair diff --git a/priv_key_recovery.js b/priv_key_recovery.js
index 35fd65d..40b68db 100644
--- a/priv_key_recovery.js
+++ b/priv_key_recovery.js
@@ -1,5 +1,5 @@
const bitcoin = require('bitcoinjs-lib');
-const ECPair = require('ecpair').ECPairFactory(require('tiny-secp256k1'));
+const { ECPair } = require('ecpair');
const base58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'.split(''); |
Thanks |
TypeError: require(...).ECPairFactory is not a function
The text was updated successfully, but these errors were encountered: