You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root@ubuntu:~/goodwill# cat package.json | grep web3
"web3": "^1.0.0-beta.48"
root@ubuntu:~/goodwill# cat test.js
/*
* Test
*/
var Web3 = require("web3");
var web3 = new Web3("http://localhost:8545");
var account = web3.eth.accounts.privateKeyToAccount("441A2D8819C881BA8A94AABB666CFEFC23038F3E000E2F09B93B0461F91E01A6");
web3.eth.accounts.wallet.add(account);
/*
* vim: ts=4 et nowrap autoindent
*/
root@ubuntu:~/goodwill# node --version
v10.15.3
root@ubuntu:~/goodwill# node test.js
/root/goodwill/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/account.js:25
const publicKey = "0x" + ecKey.getPublic(false, 'hex').slice(2);
^
TypeError: ecKey.getPublic(...).slice is not a function
at Object.fromPrivate (/root/goodwill/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/account.js:25:58)
at Function.fromPrivateKey (/root/goodwill/node_modules/web3-eth-accounts/dist/web3-eth-accounts.cjs.js:136:34)
at Proxy.privateKeyToAccount (/root/goodwill/node_modules/web3-eth-accounts/dist/web3-eth-accounts.cjs.js:341:22)
at Object.<anonymous> (/root/goodwill/test.js:7:33)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Cleanly installed ubuntu and node. It works perfectly on Debian.
The text was updated successfully, but these errors were encountered:
Cleanly installed ubuntu and node. It works perfectly on Debian.
The text was updated successfully, but these errors were encountered: