使用web3.js v0.2.6创建帐户 [英] Create an account with web3.js v0.2.6

查看:274
本文介绍了使用web3.js v0.2.6创建帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,每次我尝试使用web3创建帐户时,我总是会收到类似web3版本错误的错误,并且我应该切换到v1.0.0

so everytime i try to create an account with web3 i always get errors like the wrong version of web3 and that i should switch to v1.0.0

我使用此命令来安装web3

i used this command to install web3

  npm install ethereum/web3.js --save

我已经尝试过使用以下命令创建帐户,但是始终不匹配

i ve tried these commands to create an account but there is always a mismatch

  web3.eth.accounts.create();
web3.eth.personal.newAccount('!@superpassword')
.then(console.log);

即使安装了

npm install web3-eth-account --save 
npm install web3-eth-personal --save

有人可以帮助我吗?

推荐答案

答案是

let a=web3.personal.newAccount('!@superpassword')

这篇关于使用web3.js v0.2.6创建帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆