BUG: builder uses a package from the top level directory, not from its own.
See original GitHub issueDescribe the bug
npm for some reason, it uses a package from the top level directory, not from its own. Ambiguous behavior, seems like a bug.
Where
/main-project
├─── /node_nodules
├─── /webpack@4
├─── package.json
└─── /sub-project
│ ├── /node_nodules
│ ├── /webpack@3
│ └── package.json
Steps to Reproduce
cd .../sub-project
- Run script
npm run start
ORnpm run build
from/main-project/sub-project
. - Read error.
Current Behavior
It’s using package from folder /main-project
Giving error:
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"webpack": "4.42.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
D:\WORK\Projects\main-project\node_modules\webpack (version: 4.43.0)
Expected Behavior
It’s using package from /sub-project
.
No errors, obviously.
Did you try recovering your dependencies?
Yes. Package managers: npm, pnpm. Both didn’t work.
Which terms did you search for in User Guide?
npx create-react-app sub-project OR pnpx create-react-app sub-project
Environment
npx create-react-app --info
Environment Info:
current version of create-react-app: 3.4.1
running from C:\Users\work\AppData\Roaming\npm-cache\_npx\31100\node_modules\create-react-app
System:
OS: Windows 10 10.0.17763
CPU: (8) x64 Intel(R) Core(TM) i7-4820K CPU @ 3.70GHz
Binaries:
Node: 14.0.0 - D:\Soft\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.4 - D:\Soft\nodejs\npm.CMD
Browsers:
Edge: Not Found
Internet Explorer: 11.0.17763.771
npmPackages:
react: ^16.13.1 => 16.13.1
react-dom: ^16.13.1 => 16.13.1
react-scripts: 3.4.1 => 3.4.1
npmGlobalPackages:
create-react-app: Not Found
Also:
pnpm: 5.4.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
npm v7 does not install linked packages dependencies #2339
I believe that v6 puts all of the local install package's dependencies in its node_modules and not in the top level node_modules (hopefully ......
Read more >build_runner 2.1.5 | Dart Package - Pub.dev
This package creates a top level .dart_tool folder in your package, which should not be submitted to your source control repository. You can...
Read more >Non-standard files/directories, Rbuildignore and inst
In this post, we won't go into what these directories and files can contain and how they should be formatted, which is another...
Read more >Chapter 6. Building the package - Debian
Although use of higher level commands such as gbp buildpackage and pbuilder ensures the perfect package building environment, it is essential to understand...
Read more >Fedora Packaging Guidelines
The directory is wholly contained in your package, or involves core ... must not use the Fedora trademark, and instead roll their own...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Is this problem related to only pnpm?