版本太低導致的。
之前我是用npm install web3安裝的,結果不能用。
npm install web3安裝的,結果不能用。
重新安裝
npm init -f //此處的-f會自動給你配好配置文件
npm install web3@^0.20.0