Open DengreSarthak opened 11 months ago
I'll suggest you also show us the error from the console
Following is the error shown on the console while running the following command.
yash@DESKTOP-RK1S1NU:~/BlockChain/Hardhat-fundme-fcc$ yarn hardhat deploy --tags mocks yarn run v1.22.19 warning package.json: No license field $ /home/yash/BlockChain/Hardhat-fundme-fcc/node_modules/.bin/hardhat deploy --tags mocks Error HH303: Unrecognized task deploy
For more info go to https://hardhat.org/HH303 or run Hardhat with --show-stack-traces error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Try it this way then -
the mocks should be “mocks”
yarn hardhat deploy --tags “mocks”
Thank you but nothing changes still its showing the same error.
try yarn add --dev deploy then deploy
please add the following line to the top of the "hardhat.config.js" file:
require("hardhat-deploy");
I have the same issue. Solved by this!
Getting the issue while running command --> yarn hardhat deploy --tags mocks or yarn hardhat deploy Can't find any task which has incorrect words.
Code of 00-deploy-mocks.js
const { network } = require("hardhat"); const { developmentChains, DECIMALS, INITIAL_ANSWER } = require("../helper-hardhat-config");
module.exports = async({getNamedAccounts, deployments}) => { const {deploy, log} = deployments; const { deployer} = await getNamedAccounts(); const chainId = network.config.chainId;
}
module.exports.tags = ["all", "mocks"];
Code of 01-deploy-mocks.js
//const { getNamedAccounts, deployments } = require("hardhat")
const { network } = require("hardhat"); const { networkconfig } = require("../helper-hardhat-config");
module.exports = async({getNamedAccounts, deployments}) => { const {deploy, log} = deployments; const { deployer} = await getNamedAccounts(); const chainId = network.config.chainId;
}
Searched everywhere but can't find the solution. Can anybody please help?