Hello! Every time I run create-react-app, no matter where I make it, it says theres a problem with webpack and the dependency tree. I ran through all the steps exactly as it said, I tried stuff I found online, nothing is working. Is there something I'm missing?
Edit: 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:
E2: I solved it! For anyone who comes after, I thought the cmd was abbreviating the file path of C:\Users\Justin\node_modules\webpack (version: 4.44.1) and was referring to the node_modules folder in the project folder. Nope, turns out it doesnt do that and it was referring to an actual node_modules folder that somehow got created in my user folder. Deleting it caused it to work.
Thanks for your help. I've been googling this for the last 4 hours or so with no helpful results, if anyone else could do some googling id be extremely grateful
I don't use windows, but I take it "Justin" isn't the name of your create-react-app? If not, rename that folder, "node_modules", to something like "node_modules_bak" and try again.
Thats actually a good thing. If "Justin" is your home folder, it probably shouldn't have a node_modules folder in it. Having one is a sign that some other attempt to "npm init" happened in that location. Can you show the exact command you are running? And from what folder?
I just solved it, thanks! I updated my main comment. The whole time I thought it was just abbreviating the middle bits and it was referring to the node folder in the project folder, not that there'd be an extra somewhere by accident
View all comments
2
u/AlpinFane Sep 17 '20 edited Sep 17 '20
Hello! Every time I run create-react-app, no matter where I make it, it says theres a problem with webpack and the dependency tree. I ran through all the steps exactly as it said, I tried stuff I found online, nothing is working. Is there something I'm missing?
Edit: 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:C:\Users\Justin\node_modules\webpack (version: 4.44.1)E2: I solved it! For anyone who comes after, I thought the cmd was abbreviating the file path of
C:\Users\Justin\node_modules\webpack (version: 4.44.1)and was referring to the node_modules folder in the project folder. Nope, turns out it doesnt do that and it was referring to an actual node_modules folder that somehow got created in my user folder. Deleting it caused it to work.