Reputation: 318
I am getting this error while running npm start
on my CRA app. I tried uninstalling and installing webpack. Only thing that works is,
creating a ".env" file at the root with SKIP_PREFLIGHT_CHECK=true
.
`
[email protected] start C:\Users\USER\Desktop\MyReact\REACT_HOOKS\hello react-scripts start 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\USER\node_modules\webpack (version: 4.43.0) Manually installing incompatible versions is known to cause hard-to-debug issues. If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues. To fix the dependency tree, try following the steps below in the exact order:
react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
`Upvotes: 4
Views: 13015
Reputation: 49
I ran npm uninstall webpack
, delete package.lock.json
, and then run yarn
.
If you prefer npm, then instead of running yarn , you run npm install
.
This will re-install webpack the right way in the dependency tree.
Upvotes: 3
Reputation: 318
Ok, I ran npm uninstall -g webpack
it didn't do anything.
then I ran both
npm uninstall -g webpack
npm uninstall webpack
and it's not showing the error anymore.
so apparently
npm uninstall webpack
worked.
Probably the issue was caused by a manual download of webpack.
Upvotes: 3