Skip to content
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

Error on Ubuntu #2482

Closed
lbthomsen opened this issue Mar 10, 2019 · 0 comments · Fixed by #2526
Closed

Error on Ubuntu #2482

lbthomsen opened this issue Mar 10, 2019 · 0 comments · Fixed by #2526
Labels
Bug Addressing a bug

Comments

@lbthomsen
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants