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 locall y.
The react-scripts package provided by Create React App requires a dependency:
"babel-loader": "8.1.0"
Don't try to install it manually: your package manager does it automatically. However, a different version of babel-loader was detected higher up in the tree:
D:\Reactjs\node_modules\babel-loader (version: 8.0.6)
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 .e nv 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:
In most cases, this should be enough to fix the problem. If this has not helped, there are a few other things you can try:
If you used npm, install yarn (http://yarnpkg.com/) and repeat the above st eps with it instead. This may help because npm has known issues with package hoisting which may get resolved in future versions.
Check if D:\Reactjs\node_modules\babel-loader is outside your project direc tory. For example, you might have accidentally installed something in your home f older.
Try running npm ls babel-loader in your project folder. This will tell you which other package (apart from the expected react-scrip ts) installed babel-loader.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your pro ject. That would permanently disable this preflight check in case you want to proceed anyway.
Just add an optional dep in your package.json
:
"optionalDependencies": {
"babel-loader": "8.1.0"
},
...and run npm i
or yarn
again.
Please if you haven't already, try the troubleshooting guide. If that fails too create a .env file in your root directory add SKIP_PREFLIGHT_CHECK=true and relaunch with npm start. If that doesn't help either just use yarn instead. It should work. For most people deleting the node_modules folder and reinstalling solves the issue.
npm i yarn -g
You may have previously installed a project in your user folder. Check for a node_modules
directory and package-lock.json
in your user root.
You can remove them using:
rm -rf ~/User/node_modules
rm -rf ~/User/package-lock.json
After that delete node_module
directory and pack-lock.json
file in your project, and run npm install
again. Then it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With