React项目npm start启动失败:babel-eslint版本冲突求助
Hey there, I’ve run into exactly this frustrating issue before—when the official steps don’t work right away, it’s usually because the conflict is hiding outside your project folder. Let’s go through targeted fixes that should get your React app up and running:
First, Tackle the Root Conflict: Parent Directory Dependency
The core problem is that your user root directory (C:\Users\LENOVO\node_modules) has an outdated babel-eslint@9.0.0 that’s clashing with the 10.1.0 version required by react-scripts. The official steps only focus on your project’s local files, so they miss this. Try:
- Delete the conflicting package from your parent directory:
Open Command Prompt and run this command, or manually delete the folder via File Explorer:rmdir /s C:\Users\LENOVO\node_modules\babel-eslint
If That Doesn’t Resolve It, Try These Alternatives
Force install with legacy peer dependency handling
For newer npm versions (v7+), peer dependency checks are stricter. Navigate to your project folder and run:npm install --legacy-peer-depsThis tells npm to prioritize your project’s required versions over conflicting external dependencies.
Check for hidden conflicting dependencies in your project
Run this command in your project directory to see if any package besidesreact-scriptsis pulling in an oldbabel-eslint:npm ls babel-eslintIf you spot another package listed, update that package to a version compatible with
babel-eslint@10.1.0.Temporary workaround: Skip the preflight check
If you need to launch the app immediately (and understand the tradeoffs), create a.envfile in your project root and add this line:SKIP_PREFLIGHT_CHECK=trueThen re-run
npm start. Note: This disables critical dependency checks, so fix the root issue long-term to avoid unexpected bugs later.
Final Steps After Any Fix
No matter which solution you try, finish with these to ensure consistency:
- Delete your project’s
node_modulesfolder andpackage-lock.jsonfile - Re-run
npm install - Start the app with
npm start
内容的提问来源于stack exchange,提问作者Chandana Golla

