Hadi Ranjbar
Hadi Ranjbar

Reputation: 1812

react-script problem while having a node_module folder in the parent directory

I have another node_module folder in the parent folder of my project. I updated react-script to v2 and while I am trying to start the project I get an error like below:

The react-scripts package provided by Create React App requires a dependency:

  "webpack": "4.19.1"

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:

  /parent_dir/node_modules/webpack (version: 4.20.2)

However, my project is in this directory and has its own node_module folder:

  /parent_dir/my_project/node_modules/webpack (version: 4.20.2)

Everything goes OK if I delete parent's node_modules!

Upvotes: 1

Views: 547

Answers (1)

Hadi Ranjbar
Hadi Ranjbar

Reputation: 1812

I got that This is intended. We can skip preflight checks using instructions provided at the documentation in the react-scripts repo to solve the problem. However, I still don't know what is the reason for this pre-flight check.

Upvotes: 3

Related Questions