【问题标题】:Why npm install redux does not install? [duplicate]为什么 npm install redux 不安装? [复制]
【发布时间】:2022-01-26 12:35:36
【问题描述】:
PS D:\PracticeRDX> npm install redux
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "redux" under a package
npm ERR! also called "redux". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ti\AppData\Roaming\npm-cache\_logs\2021-12-27T15_10_10_560Z-debug.log
PS D:\PracticeRDX>

【问题讨论】:

  • 检查您的package.json 文件。选择一个不会与您的任何依赖项一起崩溃的名称。
  • 你的项目目录或项目名与包名相同
  • 我也认为这只是 npm 6 或更低版本的限制。如果你升级到最新的 npm,你可以调用你的项目redux 如果你愿意。

标签: node.js reactjs npm redux


【解决方案1】:

您使用的是最新的 npm 版本 (v7)。如日志中所述,尝试使用 npm install --legacy-peer-deps。

【讨论】:

  • 这个错误ENOSELF在npm cli 7中被删除了。并且当前最新的npm cli是版本8。OP大概使用的是npm cli 6或更早版本。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-04-04
  • 2019-07-27
  • 1970-01-01
  • 2016-04-14
  • 2019-10-10
  • 2021-09-08
  • 1970-01-01
相关资源
最近更新 更多