What / Why
npm for some reason, it uses a package from the top level directory, not from its own.
Ambiguous behavior, seems like a bug.
When
/main-project
├─── /node_nodules
├─── /webpack@4
├─── package.json
└─── /sub-project
│ ├── /node_nodules
│ ├── /webpack@3
│ └── package.json
Where
How
Steps to Reproduce
cd .../sub-project
Run script react-scripts from here (/sub-project).
Read error.
Current Behavior
It's using package from folder /main-project
Giving error: You have installed webpack@3 in /main-project
Expected Behavior
It's using package from /sub-project.
No errors, obviously.