Help me figure out how to install and use hardhat-deploy. After installing it, I add to the hardhat.config.ts file, the line - import "hardhat-deploy"; And when running a node - npx hardhat node, I get an error: TypeError: Cannot read properties of undefined (reading 'length'). If I remove this line from hardhat.config.ts, the terminal does not recognize the command - npx hardhat deploy --network localhost, after starting the node. Where is the mistake?
-
Show us the code– Olivier DemeauxDec 21, 2022 at 15:21
-
I added the picture– Sam KnightDec 21, 2022 at 15:33
1 Answer
To begin with you should add localhost network to your config which is the default hardhat network. in addition you should add this to your hardhat config:(the main reason)
namedAccounts:{
deployer:{
default:0
}
} furthermore you could use the file naming convention in the deploy folder as official docs said: 000_*.ts
last but not least you could install hardhat shorthand command to getting ride of npx hardhat
haha..
If it's useful please vote it up :)