我的配置如下,已执行安装npm install truffle-hdwallet-provider -g
,执行truffle migrate --network bsctest
时报错提示ReferenceError: HDWalletProvider is not defined
module.exports = {
networks: {
bsctest: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://data-seed-prebsc-1-s1.binance.org:8545/")
},
network_id: 97,
gasPrice: 5000000000,
},
},
mocha: {
// timeout: 100000
},
compilers: {
solc: {
}
}
};
报错信息:
wangwei@wangweidembp greeting % truffle migrate --network bsctest
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
ReferenceError: HDWalletProvider is not defined
at Object.provider (/Users/wangwei/Workspace/blockchain/ETH/greeting/truffle-config.js:6:9)
at Object.getProvider (/usr/local/lib/node_modules/truffle/build/webpack:/packages/provider/index.js:20:1)
at Object.create (/usr/local/lib/node_modules/truffle/build/webpack:/packages/provider/index.js:13:1)
at TruffleConfig.get [as provider] (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/dist/configDefaults.js:204:1)
at Object.detect (/usr/local/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:19:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:206:1
Truffle v5.1.60 (core: 5.1.60)
Node v14.15.1