question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm start error with preflight check

See original GitHub issue

So, I have a Loopback 3 Project inside geccomat - Copy and a React App from create-react-app 2 inside geccomat - Copy\client-src. Loopback uses it’s own dependencies, including eslint 3.19.0, whereas create-react-app uses eslint 5.6.0. Theoretically, as Loopback is an outer project, it wouldn’t affect the inner React App, but when I run npm start for the react app, it outputs this:

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:

  "eslint": "5.6.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:

  C:\Users\G1745 IRON\Desktop\geccomat - Copy\node_modules\eslint (version: 3.19.0)

Manually installing incompatible versions is known to cause hard-to-debug issues.

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

  5. 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.

  6. Check if C:\Users\G1745 IRON\Desktop\geccomat - Copy\node_modules\eslint is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

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

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! client-src@0.1.0 start-js: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client-src@0.1.0 start-js 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:
npm ERR!     C:\Users\G1745 IRON\AppData\Roaming\npm-cache\_logs\2018-11-16T19_45_21_488Z-debug.log
ERROR: "start-js" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client-src@0.1.0 start: `set PORT=3001 && npm-run-all -p watch-css start-js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client-src@0.1.0 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:
npm ERR!     C:\Users\G1745 IRON\AppData\Roaming\npm-cache\_logs\2018-11-16T19_45_21_826Z-debug.log

package-lock.json for the client-src folder has eslint 5.6.0, as expected, but it doesn’t let me run the app. I deleted both the node_modules folders and ran npm i again, but to no success.

I don’t know if this is exactly a bug or not, but it’s something that doesn’t make sense in my head. I may be wrong on thinking the outer dependencies won’t affect the inner dependencies, though.

It works fine with react-scripts 1.1.5, issue being that I need to use an npm package that only gets built if I use react-scripts 2.1.1

What could I do?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
kilodaltoncommented, Nov 18, 2018

I noticed this as well.

The package.json for eslint-config-react-app (in the node_modules of the react-scripts directory) calls for

  • "eslint": "5.x",

This installs eslint 5.9… which appears to override the explicit "5.6.0" in the main directory’s package.json as well as react-script’s package.json because it sees the package as already installed at that step I suppose.

If you yarn remove eslint and re-do yarn install in the main directory. It will then install eslint 5.6.0 and your preflight check should pass.

It’s a little bit hack-y, but it temporarily solves the problem.

One of these changes could be adopted by the maintainers to solve the problem:

  • eslint-config-react-app package.json can be amended to be in sync with the expectations of the parent package or
  • react-script’s package.json needs to be upgraded to 5.9.0 so the preflight passes, or changed to to a more flexible 5.x or
  • vice versa.

Not sure if this bug should be targeted towards the eslint-config-react-app or the react-script or the create-react-app maintainers.

Fixing the eslint version in react-script’s package.json and/or eslint-config-react-app’s package.json does make the preflight check error message go away.

1reaction
ghostcommented, Jan 4, 2019

Also fixed as per @agrcrobles comment, but this isn’t great as I was using a more recent version of eslint further up the project tree.

Relevant issue in react-scripts repo: https://github.com/facebook/create-react-app/issues/5933

Read more comments on GitHub >

github_iconTop Results From Across the Web

'npm start' returns error: "There might be a problem with the ...
In my case, I solved my problem in this way. create a .env at the root of the folder react folder; type SKIP_PREFLIGHT_CHECK=true...
Read more >
Preflight check error when installing NPM using the ...
When you run the SolarWinds Orion Installer, select your desired modules, the following error displays: A preflight check did not finish. An ...
Read more >
NPM start error | Quick fix - YouTube
In this video, we will learn how to fix the NPM start error using a .ENV file.Command: skip_preflight_check=true This command essentially ...
Read more >
Preflight Check, a new utility to keep developer's ...
Preflight Check, a new utility to keep developer's dependencies in sync · Developer A adds a new dependency to package. · Developer B...
Read more >
Lift-Off I Setup Client Error - eslint version incompatibility?
Hey there, I'm having an issue with eslint and running npm start in the client ... That would permanently disable this preflight check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found