【问题标题】:Dependencies on scoped package vs yarn范围包与纱线的依赖关系
【发布时间】:2018-07-22 15:46:43
【问题描述】:

我创建了带有内容的范围包@scope/eslint-config

{
  "name": "@scope/eslint-config",
  "version": "1.0.3",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "babel-eslint": "8.2.5",
    "eslint": "5.1.0",
    "eslint-config-airbnb": "17.0.0",
    "eslint-config-prettier": "2.9.0",
    "eslint-plugin-css-modules": "2.7.5",
    "eslint-plugin-flowtype": "2.50.0",
    "eslint-plugin-import": "2.13.0",
    "eslint-plugin-jsx-a11y": "6.1.0",
    "eslint-plugin-prettier": "2.6.2",
    "eslint-plugin-react": "7.10.0",
    "eslint-plugin-require-jsdoc-except": "1.1.0"
  }
}

并在我的项目中将其添加为"@scoped/eslint-config": "1.0.2",

但是在运行yarn install 之后,我只看到没有任何依赖关系的那个包。但它适用于 npm

yarnv1.8.0、v1.7.0 和v1.6.0我都试过了

你遇到过麻烦吗?有什么解决办法吗?

【问题讨论】:

    标签: npm yarnpkg npmjs


    【解决方案1】:

    在 npm 中,由于结构扁平,它可以工作。

    对于纱线,你需要说--flat,但它会引起其他麻烦

    https://github.com/eslint/eslint/issues/5501

    https://github.com/eslint/eslint/issues/3458

    【讨论】:

      猜你喜欢
      • 2021-12-22
      • 2020-08-07
      • 2019-08-23
      • 2011-04-24
      • 2012-05-20
      • 2019-06-27
      • 1970-01-01
      • 1970-01-01
      • 2014-02-24
      相关资源
      最近更新 更多