There might be a problem with the project dependency tree.
See original GitHub issueHi!
The issue is simple
I have the same problem as in https://github.com/facebook/create-react-app/issues/5972
But I do not want to remove the other node_modules that lives higher up in the tree
Your docs and similar issues tells me to remove that node_modules, but it was made on purpose
I would like
- either to run
npm run build
without error - or to understand why this is not feasible
Any stable work-arounds are welcome
Environment
Environment Info:
System:
OS: Linux 4.15 Ubuntu 16.04.6 LTS (Xenial Xerus)
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
Yarn: 1.21.1 - /usr/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.4.0/bin/npm
Browsers:
Chrome: 79.0.3945.88
Firefox: 72.0.1
npmPackages:
react: ^16.10.2 => 16.10.2
react-dom: ^16.10.2 => 16.10.2
react-scripts: ^3.3.0 => 3.3.0
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
- npx create-react-app my-app
- npm init
- npm install webpack
- cd my-app
- npm run build
Expected behavior
npm run build
builds the project, ignoring any node_modules living higher up in the tree.
That means, npm run build
consider my-app
as the root of the project and does not look in my home.
Actual behavior
A pre-flight check warning shows up. It assumes that the node_modules living higher up in the tree is accidental, which is not.
I do not want to skip preflight checks because:
- This is production content, I cannot take risks
- Seems like we cannot disable only that check
Reproducible demo
I believe the steps to reproduce, do reproduce the problem in every case.
If you really can’t reproduce, I will make a demo repo.
Thank you
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top GitHub Comments
I need to think about this more, but I think that if it’s higher up in the tree it probably isn’t a problem. We could perhaps make the preflight check less restrictive here. Really not sure though!
Just the nature of the beast. When you require something, node uses its resolution algorithm, and node’s resolution algorithm recursively checks the node_modules of parent directories.
It’s not really a webpack check, it’s just something we do to avoid mismatched versions. Setting
SKIP_PREFLIGHT_CHECK=true
will indeed just turn the check off.Thanks @heyimalex