【问题标题】:Install all unmet dependencies in yarn在纱线中安装所有未满足的依赖项
【发布时间】:2021-02-09 01:26:08
【问题描述】:

我的反应应用程序有错误,它说:

    Line 0:  Parsing error: Cannot find module 'eslint-scope' from '/home/path/.cache/yarn/v6/npm-eslint-7.11.0-aaf2d23a0b5f1d652a08edacea0c19f7fadc0b3b-integrity/node_modules/eslint/lib/api.js'

然后我使用以下命令将 eslint-scope 添加到我的依赖项中:

    yarn add eslint-scope

但我发现了很多未满足的对等依赖项:

    warning " > @testing-library/user-event@12.1.10" has unmet peer dependency "@testing-library/dom@>=7.21.4".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "@typescript-eslint/eslint-plugin@^4.0.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "@typescript-eslint/parser@^4.0.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "babel-eslint@^10.0.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-flowtype@^5.2.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-import@^2.22.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.3.1".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-react@^7.20.3".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-react-hooks@^4.0.8".

当我尝试安装其中一个时,我发现了另一个未满足的依赖项:

    warning " > @testing-library/user-event@12.1.10" has unmet peer dependency "@testing-library/dom@>=7.21.4".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "@typescript-eslint/eslint-plugin@^4.0.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "@typescript-eslint/parser@^4.0.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-flowtype@^5.2.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-import@^2.22.0".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.3.1".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-react@^7.20.3".
    warning " > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint-plugin-react-hooks@^4.0.8".

我可以自动安装所有不满足的依赖项吗?

【问题讨论】:

    标签: javascript node.js reactjs dependencies yarnpkg


    【解决方案1】:

    首先你应该通过运行这个命令yarn why eslint-scope来找出为什么需要eslint-scope

    如果您仍然认为需要它,那么您应该知道默认情况下不再安装对等依赖项。 You can read more about it here。在 NPM V7 中 peerDependencies 是 installed automatically again

    现在你应该尝试使用install-peerdepsnpx install-peerdeps -Y eslint-scope

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-17
      • 1970-01-01
      • 1970-01-01
      • 2018-09-18
      • 2013-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多