yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.72k forks source link

Package dependencies are not installed in root node_modules of project #4578

Open Ponjimon opened 6 years ago

Ponjimon commented 6 years ago

I wanted to use https://github.com/smashcast/eslint-config-smashcast but it seems that yarn is installing the dependencies differently to how npm installs it.

Do you want to request a feature or report a bug? Bug

What is the current behavior? It installs the dependencies only in the package's node_modules folder, but not in the node_modules folder of the project root. When installing the same package with npm, it works.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Run yarn add --dev eslint-config-smashcast
  2. Look at the node_modules folder of your project
  3. You will not see the dependencies of eslint-config-smashcast (for example eslint-plugin-react) in there but instead they are in node_modules/eslint-config-smashcast/node_modules

What is the expected behavior? The dependencies of eslint-config-smashcast are in the project's root node_modules folder.

Please mention your node.js, yarn and operating system version. Yarn 1.1.0 Node 6.9.0 Windows 10 x64

OmerHerera commented 6 years ago

I'm experiencing the same issue with the another versions:

node: v6.10.0
npm: 3.10.10
yarn: 1.3.2

It was working with previous yarn(version 0.27), since I upgrade my yarn to 1.3.2, stop working like before.

What is the expected behavior or how we can set a workaround to make it work. My solution for now is to installing manually the missing modules in the root folder, but this is not a good solution.

why520crazy commented 3 years ago

Any news?