版本太低导致的。
之前我是用npm install web3安装的,结果不能用。
npm install web3安装的,结果不能用。
重新安装
npm init -f //此处的-f会自动给你配好配置文件
npm install web3@^0.20.0