You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React项目npm start启动失败:babel-eslint版本冲突求助

Fix for React App Start Error: Mismatched babel-eslint Version in Parent Directory

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

  1. 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-deps
    

    This tells npm to prioritize your project’s required versions over conflicting external dependencies.

  2. Check for hidden conflicting dependencies in your project
    Run this command in your project directory to see if any package besides react-scripts is pulling in an old babel-eslint:

    npm ls babel-eslint
    

    If you spot another package listed, update that package to a version compatible with babel-eslint@10.1.0.

  3. Temporary workaround: Skip the preflight check
    If you need to launch the app immediately (and understand the tradeoffs), create a .env file in your project root and add this line:

    SKIP_PREFLIGHT_CHECK=true
    

    Then 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_modules folder and package-lock.json file
  • Re-run npm install
  • Start the app with npm start

内容的提问来源于stack exchange,提问作者Chandana Golla

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 14:37:40