简体   繁体   English

依赖范围内的卷装与纱线

[英]Dependencies on scoped package vs yarn

I've created scoped package @scope/eslint-config with content 我已经创建了包含内容的作用域包@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"
  }
}

and in my project added it as "@scoped/eslint-config": "1.0.2", 并在我的项目中将其添加为"@scoped/eslint-config": "1.0.2",

However after running yarn install I see only that package without any dependency. 但是,在运行yarn install我只能看到该软件包,而没有任何依赖性。 But it works with npm 但是它可以与npm一起使用

I've tried both yarn v1.8.0 , v1.7.0 and v1.6.0 我已经尝试过yarn v1.8.0v1.7.0v1.6.0

Have you met the troubles? 你遇到麻烦了吗? Any solution? 有什么办法吗?

In npm it works due to the flattern structure. 在npm中,由于使用flattern结构,因此可以工作。

For yarn you need to say --flat but it causes other troubles 对于纱线,您需要说- --flat但这会带来其他麻烦

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM