Skip to content

SebastianBogado/yarn-peer-dependencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repo for reproducing issue yarn#5978

Summary of the issue

Yarn installs the hoisted version of a dependency (React 15) inside another dependency (react-redux) which doesn't explicitely requires it, only through peer dependencies. All while the app that requires react-redux, is using React 16.

Detailed explanation

There are three independent packages. Two of those work with React 15, and the other works with React 16. The three of them work with react-redux v5.0.7.

When running yarn install, React 15 and react-redux v5.0.7 get hoisted at the root. The third package gets React 16 installed. The third package also gets react-redux installed in its own node_modules because of "nohoist" config.

The issue is that React 15 gets installed inside that no-hoisted version of react-redux

$ tree -d .
.
├── applications
│   ├── my-first-app
│   │   └── frontend
│   ├── my-second-app
│   │   └── frontend
│   └── my-third-app
│       └── frontend
│           └── node_modules
│               ├── [email protected]
│               ├── [email protected]
│               └── [email protected]
│                   └── node_modules
│                       └── [email protected]
└── node_modules
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    └── [email protected]
    (...among others)

Steps

Have install yarn v1.6.0 and then at the root run:

$ yarn install

About

Repo to reproduce yarn peer dependencies issue. More info at https://github.com/yarnpkg/yarn/issues/5978

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published