如何正确安装eslint-config-airbnb? `UNMET PEER DEPENDENCY` [英] How to install eslint-config-airbnb properly ? `UNMET PEER DEPENDENCY`

查看:449
本文介绍了如何正确安装eslint-config-airbnb? `UNMET PEER DEPENDENCY`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

➜  beslint git:(master) ✗ eslint -v
    v3.15.0
➜  beslint git:(master) ✗ npm install -g eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-react

/Users/next/.nvm/versions/node/v7.5.0/lib
├── UNMET PEER DEPENDENCY eslint@^3.15.0
├─┬ eslint-config-airbnb@14.1.0
│ └── UNMET PEER DEPENDENCY eslint@^3.15.0
├── eslint-plugin-import@2.2.0
├── eslint-plugin-jsx-a11y@4.0.0
└── eslint-plugin-react@6.10.0

npm WARN eslint-config-airbnb@14.1.0 requires a peer of eslint@^3.15.0 but none was installed.
npm WARN eslint-config-airbnb-base@11.1.0 requires a peer of eslint@^3.15.0 but none was installed.
npm WARN eslint-plugin-import@2.2.0 requires a peer of eslint@2.x - 3.x but none was installed.
npm WARN eslint-plugin-jsx-a11y@4.0.0 requires a peer of eslint@^2.10.2 || 3.x but none was installed.
npm WARN eslint-plugin-react@6.10.0 requires a peer of eslint@^2.0.0 || ^3.0.0 but none was installed.
➜  beslint git:(master) ✗




  • 我累了全局安装

  • 我使用nvm安装节点7.5.0 ,并在全球安装了eslint。

  • 当我尝试在全球范围内安装 eslint-config-airbnb 时。

  • 它说 UNMET PEER DEPENDENCY

    • I tired to install globally
    • I use nvm to install node 7.5.0, and installed eslint globally.
    • when I try to install eslint-config-airbnb globally.
    • It said UNMET PEER DEPENDENCY
    • 推荐答案

      您可以安装 eslint -config-的Airbnb束。这是与ESLint捆绑在一起的未经更改的 Airbnb样式指南配置,以解决安装带来的一些不便(如未完成的对等依赖项警告)。您也可以在全球范围内安装它:

      You can install eslint-config-airbnb-bundle. This is an unaltered Airbnb style guide config bundled with ESLint in a single package to solve some inconvenience with the installation (like unmet peer dependency warnings). You can install it globally as well:

      npm i -g eslint-config-airbnb-bundle
      

      仅限Airbnb: https://www.npmjs.com/package/eslint-config-airbnb-bundle

      Airbnb + Standard:< a href =https://www.npmjs.com/package/eslint-config-airbnb-standard =nofollow noreferrer> https://www.npmjs.com/package/eslint-config-airbnb-standard

      Airbnb + Standard: https://www.npmjs.com/package/eslint-config-airbnb-standard

      这篇关于如何正确安装eslint-config-airbnb? `UNMET PEER DEPENDENCY`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆