我正在尝试运行cmd
npm install --save-dev "hardhat@^2.17.1" "@nomicfoundation/hardhat-toolbox@^3.0.0"
运行时我收到此错误日志
npm install --save-dev "hardhat@^2.17.1" "@nomicfoundation/hardhat-toolbox@^3.0.0"
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/ethers
npm ERR! ethers@"^5.7.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer ethers@"^6.1.0" from @nomicfoundation/[email protected]
npm ERR! node_modules/@nomicfoundation/hardhat-ethers
npm ERR! peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/[email protected]
npm ERR! node_modules/@nomicfoundation/hardhat-toolbox
npm ERR! dev @nomicfoundation/hardhat-toolbox@"3.0.0" from the root project
npm ERR! peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/[email protected]
npm ERR! node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR! peer @nomicfoundation/hardhat-chai-matchers@"^2.0.0" from @nomicfoundation/[email protected]
npm ERR! node_modules/@nomicfoundation/hardhat-toolbox
npm ERR! dev @nomicfoundation/hardhat-toolbox@"3.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\\AppData\Local\npm-cache\_logs\2023-08-24T20_39_45_411Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: C:\Users\liamr\AppData\Local\npm-cache\_logs\2023-08-24T20_39_45_411Z-debug-0.log
PS C:\Users\liamr\tracking>
我首先做了npm i hardhat
,没有任何问题,然后我做了npx hardahat
,满足了所有要求,然后它说 You need to install these dependencies to run the sample project: npm install --save-dev "hardhat@^2.17.1" "@nomicfoundation/hardhat-toolbox@^3.0.0"
,我不小心做了 npm install --save-dev "hardhat@^2.17.1" 没有最后一个安全帽工具箱,然后我意识到我的错误,我现在被困在这里。