Problems with babel loader in react-create-app

后端 未结 11 1212
孤城傲影
孤城傲影 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:22

    I had this exact same issue. For anyone who finds this thread via Google and is a beginner like me. Here is exactly what to enter into your terminal(Mac User).

    Say you're getting the same error that Paul was getting:

    "The react-scripts package provided by Create React App requires a dependency: "babel-loader": "8.0.6"

    Here's what I entered into the terminal. I could be wrong, but this is what worked for me (I am also a beginner):

    Step 1: Delete the node_modules folder as well as the package_lock.json files.

    Step 2: In your terminal, type cd - (we're just getting outside of our project folder and going into your home folder)

    Step 3: In your terminal type in npm i "dependency-name@number" so for the above example it would be: npm i babel-loader@8.0.6

    Step 4: Now in your terminal, navigate into your project folder and type: npm install or yarn install

    Step 5: Try running npm start and if all the issues have been solved, it should start the development server.

    Note: I had to do the above process twice, for babel-loader@8.0.6 as well as for Webpack.

提交回复
热议问题