web3 getAccounts 没有得到解决

web3 getAccounts doesn't get resolved

web3.eth.getAccounts() 对我不起作用。下面的代码显示 "error" 执行(被拒绝)。我正在使用 web3 1.0.0 beta-46。我正在学习 Stephen Grider 的教程视频,他使用的是 beta-26,是版本相关问题还是我做错了什么?

const assert = require('assert');
const ganache = require('ganache-cli');
const Web3 = require('web3');
const web3 = new Web3(ganache.provider());

web3.eth.getAccounts()
    .then(fetchedAccounts => {
      console.log(fetchedAccounts);
    },() => {
      console.log("error");
    });

我自己还没有尝试过,但这似乎是 web3 最新版本的一个错误。试试 1.0.0 beta-37 ?