首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >web3.eth.getAccounts():无法读取未定义的属性“map”

web3.eth.getAccounts():无法读取未定义的属性“map”
EN

Ethereum用户
提问于 2019-02-20 09:59:39
回答 2查看 1.4K关注 0票数 1
代码语言:javascript
复制
 const HDWalletProvider = require('truffle-hdwallet-provider');
 const Web3 = require('web3');
 const provider = new HDWalletProvider( 'passphrase', 'rinkeby.infura.io/v3/mytoken' );
 const web3 = new Web3(provider);
 const deploy = async () =>{ const accounts = await web3.eth.getAccounts(); } deploy();

给出

TypeError:无法读取GetAccountsMethod.afterExecution上未定义的属性“map”

使用的版本:

代码语言:javascript
复制
 "solc": "^0.4.24",
 "truffle-hdwallet-provider": "^1.0.4",
 "web3": "^1.0.0-beta.46" 

任何解决办法都应该感激。提前谢谢。

EN

回答 2

Ethereum用户

发布于 2021-04-08 09:55:53

您可能需要删除目录中的块菌构建。

代码语言:javascript
复制
rm -R build/
票数 0
EN

Ethereum用户

发布于 2021-05-07 20:04:58

我遇到了同样的错误,在我的例子中,我意外地导入了dbg.json文件,而不是json文件。

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/67357

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档