【问题标题】:Cannot install under npm packages anymore无法再安装在 npm 包下
【发布时间】:2023-02-22 05:40:02
【问题描述】:

当我想在 npm 下安装一些东西时,我得到一个错误。我尝试了很多方法来修复它,但都失败了。这是错误

npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: @nomiclabs/hardhat-ethers@0.3.0-beta.13
npm ERR! node_modules/@nomiclabs/hardhat-ethers        
npm ERR!   dev @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.1.1
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/hardhat-waffle@2.0.3
npm ERR!   node_modules/@nomiclabs/hardhat-waffle
npm ERR!     dev @nomiclabs/hardhat-waffle@"^2.0.3" 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! See C:\Users\Mazhar\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mazhar\AppData\Local\npm-cache\_logs\2022-09-11T23_40_30_606Z-debug-0.log
PS C:\Users\Mazhar\Documents\Alchemy-weekly\nft-marketplace-scratch> 

【问题讨论】:

  • 尝试使用yarn安装
  • 纱线工作正常,但我想知道问题是什么 npm 包管理器。有没有像windows hardhat 安装问题一样的npm 的windows 问题?
  • 一定有一些 npm 缓存问题,或者某些包版本可能正在这样做。
  • 我使用根文件夹和缓存文件夹卸载节点和 npm。但什么都不会改变。但在 ``` Linux `` 中一切正常。 Windows 有什么问题?

标签: node.js npm npm-install


【解决方案1】:

我遇到过同样的问题。就我而言,问题是我正在单独安装软件包。然后我一次安装了所有的包,它运行良好。

而且,如果你有这个包,你可以删除它:solidity-coverage

以下是安装包的方法:

npm install "react-router-dom" "hardhat" "ethers" "@nomicfoundation/hardhat-toolbox" "dotenv" "@nomiclabs/hardhat-ethers" "@openzeppelin/contracts" "@chainlink/contracts" "@nomicfoundation/hardhat-network-helpers@^1.0.0" "@nomicfoundation/hardhat-chai-matchers@^1.0.0" "@nomiclabs/hardhat-etherscan@^3.0.0" "@types/mocha@^9.1.0" "@typechain/ethers-v5@^10.1.0" "@typechain/hardhat@^6.1.2" "chai@^4.2.0" "ts-node@>=8.0.0" "typechain@^8.1.0" "typescript@>=4.5.0"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-12
    • 1970-01-01
    • 1970-01-01
    • 2016-09-19
    • 2016-11-29
    相关资源
    最近更新 更多