I watched a React.js tutorial and followed through every step, but it seems like I can't even get the first step right. The tutorial is here around the 16:10 mark.
The instructions told me to download node.js / npm (my version is 6.13.4), and then run npm create-react-app (app name here)
. I did it, and then right away tries to run npm start
. The tutorial had no trouble doing so, but when I did it, it gave me this error:
Failed to compile.
./src/index.js 1:57
Module parse failed: Unexpected token (1:57)
File was processed with these loaders:
* ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
> $RefreshRuntime$ = require('C:/Users/Jack/Documents/Jack's Workshop/Coding/react/amogus2/node_modules/react-refresh/runtime.js');
| $RefreshSetup$(module.id);
Forgive me for my ignorance, but I have no idea where to start looking for this error, because I have not done a single thing to modify the template automatically given to me through create-react-app
.
I tried looking around online for solutions, and found a thing I'm supposed to have called "webpack.config.js", yet it is neither in the root file nor in the ./src file. I searched for the name in the entire project and found several types of this config file. I thought the most probably one is in node_modules/react-scripts/config/webpack.config.js
.
What do I do to get rid of this error? Thanks in advance!