Problems with babel loader in react-create-app

后端 未结 11 1215
孤城傲影
孤城傲影 2021-02-18 16:50

The Problem

create-react-app initializes a repository where babel-loader is installed as an older version than needed.

LOG:

There          


        
相关标签:
11条回答
  • 2021-02-18 17:31

    this means you install tow babel-loader

    rm yarn.lock
    run npm uninstall babel-loader@8.0.4
    
    0 讨论(0)
  • 2021-02-18 17:37

    On Mac:

    Remove the conflicting package from /Users/<yourusername>/node_modules

    0 讨论(0)
  • 2021-02-18 17:37

    I was having this issue and just added in

    "babel-loader": "8.0.4",
    

    to my package.json in the dependencies and it seemed to fix the issue

    0 讨论(0)
  • 2021-02-18 17:38

    I got the same problem. I solved it by removing folder node_modules in User/ and file package-lock.json (if exists). It should work perfectly then.

    0 讨论(0)
  • 2021-02-18 17:38

    I have also problems after creating an app-project using the following commands:

    create-react-app "project name"
    create-react-app "project name" --use-npm
    npx create-react-app. 
    

    On all cases the result was the error specified right in the top:

    [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.......][...]

    watching on the error a line came with a small clue:

    "/Users/john/node_modules/babel-loader (version: "7.1.5") -> was a version that creates conflict with above specified - version "babel-loader@8.0.6"

    for me the solution was: following this path through my folders and delete the node_modules folder then restart again the project.

    0 讨论(0)
提交回复
热议问题