简体   繁体   中英

Creating React app failed. I used npm init react-app my-app

Please, someone help me with this Error:

在此处输入图片说明

I used npm to create the React app. I can not use npx create-react-app , because is takes more than 40 min to create the app even with high speed internet.

node - v14.17.3

npm - 7.20.0

browser - Google

here is the error from launched page.

Failed to compile ./src/index.js 1:35 Module parse failed: Unexpected token (1:35) 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('D:/LET'S LEARN SOMETHING/CODING/HTML_CSS_JAVASCRIPT/REACT-WORKING/react-test/node_modules/react-refresh/runtime.js'); | $RefreshSetup$(module.id);

在此处输入图片说明

I think I found the problem. The "react-scripts": "^4.0.3" is the issue. Somehow create-react-app is breaking with react-scripts(4.0.3). Once I downgraded to 4.0.1, the app launched successfully. As far as I can see, the latest version of react-scripts which is 4.0.3 does not support create-react-app launch.

Possibly problem with file path - D:/LET'S LEARN SOMETHING/

Change it to something without spaces and special characters like D:/let_learn_something/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM