Closed ccolorado closed 3 months ago
Hey @ccolorado not sure what are using but this doesn't seem something generated by plain npx create-eth@latest
and choosing hardhat as solidity framework. Are you using any extension?
Ideally the packages/hardhat
should look like this:
{
"name": "@se-2/hardhat",
"version": "0.0.1",
"scripts": {
"account": "hardhat run scripts/listAccount.ts",
"chain": "hardhat node --network hardhat --no-deploy",
"compile": "hardhat compile",
"deploy": "hardhat deploy",
"flatten": "hardhat flatten",
"fork": "MAINNET_FORKING_ENABLED=true hardhat node --network hardhat --no-deploy",
"format": "prettier --write ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts",
"generate": "hardhat run scripts/generateAccount.ts",
"hardhat-verify": "hardhat verify",
"lint": "eslint --config ./.eslintrc.json --ignore-path ./.eslintignore ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts",
"lint-staged": "eslint --config ./.eslintrc.json --ignore-path ./.eslintignore",
"test": "REPORT_GAS=true hardhat test --network hardhat",
"verify": "hardhat etherscan-verify"
},
"dependencies": {
"@openzeppelin/contracts": "~4.8.1",
"@typechain/ethers-v6": "~0.5.1",
"dotenv": "~16.0.3",
"envfile": "~6.18.0",
"qrcode": "~1.5.1"
},
"devDependencies": {
"@ethersproject/abi": "~5.7.0",
"@ethersproject/providers": "~5.7.1",
"@nomicfoundation/hardhat-chai-matchers": "~2.0.3",
"@nomicfoundation/hardhat-ethers": "~3.0.5",
"@nomicfoundation/hardhat-network-helpers": "~1.0.6",
"@nomicfoundation/hardhat-verify": "~2.0.3",
"@typechain/ethers-v5": "~10.1.0",
"@typechain/hardhat": "~9.1.0",
"@types/eslint": "~8",
"@types/mocha": "~9.1.1",
"@types/prettier": "~2",
"@types/qrcode": "~1",
"@typescript-eslint/eslint-plugin": "~6.7.3",
"@typescript-eslint/parser": "~6.7.3",
"chai": "~4.3.6",
"eslint": "~8.26.0",
"eslint-config-prettier": "~8.5.0",
"eslint-plugin-prettier": "~4.2.1",
"ethers": "~6.10.0",
"hardhat": "~2.19.4",
"hardhat-deploy": "~0.11.45",
"hardhat-deploy-ethers": "~0.4.1",
"hardhat-gas-reporter": "~1.0.9",
"prettier": "~2.8.4",
"solidity-coverage": "~0.8.5",
"ts-node": "~10.9.1",
"typechain": "~8.1.0",
"typescript": "~5.1.6"
}
}
Yeah I think I thinker a little bit with that installation, installing whatever the error message indicated me.
Maybe the issue is local, but I can't imagine what is going on.
So I ran this :
npx create-eth@latest new -s hardhat && cd new && npx hardhat compile || cat package.json
Same error on compileError: Cannot find module '@nomicfoundation/hardhat-chai-matchers'
but my package.json is somewhat different. (removed the script section 20+ lines )
{
"name": "se-2",
"version": "0.0.1",
"private": true,
"workspaces": {
"packages": [
"packages/*"
]
},
"devDependencies": {
"husky": "~8.0.3",
"lint-staged": "~13.2.2"
},
"packageManager": "yarn@3.2.3",
"engines": {
"node": ">=18.17.0"
}
}
Ohh actually npx hardhat compile
won't work since you are at root of monorepo.
npx create-eth@latest new -s hardhat && cd new && yarn compile
also we are using yarn instead of npm. you could run yarn compile
(which compiles things in hardhat) or you could first cd packages/hardhat
and then run yarn hardhat compile
Closing this for now, but let us know if it still doesn't work
Is there an existing issue for this?
Which method was used to setup Scaffold-ETH 2 ?
npx create-eth@latest
Current Behavior
npx hardhat compile crashes with error:
Expected Behavior
Hardhat should be ready to compile.
Steps To Reproduce
having node v20.12.1 (nvm lts)
npx create-eth@latest choose hardhat npx hardhat compile
Anything else?
Tested with node v18.20.4 Generated package.json