Create-react-app: issue when npm start

Created on 4 Apr 2020  ·  14Comments  ·  Source: facebook/create-react-app

G:react\myapp>npm start

[email protected] start G:react\myapp
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:

"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:

G:node_modulesbabel-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 .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:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-loader" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

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:

  1. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
    This may help because npm has known issues with package hoisting which may get resolved in future versions.

  2. Check if G:node_modulesbabel-loader is outside your project directory.
    For example, you might have accidentally installed something in your home folder.

  3. Try running npm ls babel-loader in your project folder.
    This will tell you which other package (apart from the expected react-scripts) installed babel-loader.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: 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.

npm ERR! A complete log of this run can be found in:

needs triage stale

Most helpful comment

I just create .env file in my app folder add SKIP_PREFLIGHT_CHECK=true.
It's work.
Thanx Tsioriantenaina.

All 14 comments

You have another package that is installing babel-loader 8.1.0. react-scripts has a strict requirement for 8.0.6. run "npm ls babel-loader" and it will tell you which package is installing 8.1.0.

follow my instruction:
$ cd your_app
$ rm -r node_modules package-lock.json yarn.lock
$ vim package.json
remove babel-loader from devDependencies list or dependencies list, if you found it, just remove it.
then install babel-loader via "npm install [email protected]" like @foestauf said.

if the results still print error, install create-react-app via yarn or manual installation using nodejs-yarn install react, react-scripts, cra-templates, if you are fedora 31 user, I can't help you.

You have another package that is installing babel-loader 8.1.0. react-scripts has a strict requirement for 8.0.6. run "npm ls babel-loader" and it will tell you which package is installing 8.1.0.

I have the same issue,:-
C:\Users\AHMAD\Documentsreact\learn>npm ls babel-loader
[email protected] C:\Users\AHMAD\Documentsreact\learn
-- [email protected] -- [email protected]

What is the next step to fix this.

You have another package that is installing babel-loader 8.1.0. react-scripts has a strict requirement for 8.0.6. run "npm ls babel-loader" and it will tell you which package is installing 8.1.0.

I am already donw all .but it can't help me

You have another package that is installing babel-loader 8.1.0. react-scripts has a strict requirement for 8.0.6. run "npm ls babel-loader" and it will tell you which package is installing 8.1.0.

I have the same issue,:-
C:\Users\AHMAD\Documentsreact\learn>npm ls babel-loader
[email protected] C:\Users\AHMAD\Documentsreact\learn
-- [email protected]-- [email protected]

What is the next step to fix this.

I am not still.😬

installing

yeah i install they want but it not work

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

I have exactly the same issue

You must just create .env file in your app folder and add SKIP_PREFLIGHT_CHECK=true
run yarn start or npm start
It's work for me .

I just create .env file in my app folder add SKIP_PREFLIGHT_CHECK=true.
It's work.
Thanx Tsioriantenaina.

I ran into the same exact issue. Disabling preflight checks seemed extreme, they are there for a reason. So I dug into it a bit more. What I found in my case is that I actually had another version of babel-loader installed outside the project folder (so step 6 in the troubleshooting steps provided was the issue). After removing it the start command worked without issue.

What led me to this was actually the output in the error where it provides the path to the other version of babel-loader detected. In looking at the OPs (@jahidmomin) output we can see that they appear to have the same issue that I did.

They are starting the app from: G:\react\myapp (This has the requirement for babel-loader v8.1.0.)
However another conflicting version (v8.0.6) is found at: G:\node_modules\babel-loader. (This version should be removed.)

The only version should be the one create-react-app installs in their myapp project folder... I.e. G:\react\myapp\node_modules\babel-loader.

I hope that helps people solve this! :)

I just create .env file in my app folder add SKIP_PREFLIGHT_CHECK=true.
It's work.
Thanx Tsioriantenaina.

how to create .env file?

just create new text file, put in SKIP_PREFLIGHT_CHECK=true., then rename
this file in .env

сб, 15 серп. 2020 о 15:49 Attaria786 notifications@github.com пише:

I just create .env file in my app folder add SKIP_PREFLIGHT_CHECK=true.
It's work.
Thanx Tsioriantenaina.

how to create .env file?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/create-react-app/issues/8781#issuecomment-674392761,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMZC274EWNLH3CW75IEG45DSAZ76RANCNFSM4L5SXV2A
.

Was this page helpful?
0 / 5 - 0 ratings