React: Module parse failed - reactjs

I finished setting up node v13.14.0 on my windows 7 laptop then did "npm react-create-app name". After done downloading I was greeted with this error...
Image of my error
I tried searching it on stackoverflow there was a solution about webpack.config.js but I couldn't find it on my folder section.
vscode-folder-structure
Any idea, should reinstall ?

I got around this by creating a new user in windows (I found the solution on github comments somewhere ), then logged in as that user and installed "npx create-react-app app-name" and it worked somehow ¯_(ツ)_/¯.
enter image description here

If you are installing then use npm i create-react-app. If you are trying to creating react app then use npx create-react-app appname. If you have another issue then please elaborate on that issues.

Related

Why is the create-react-app command not working?

Wanted to create a new react app, and ran both npx create-react-app and init react-app command in my Mac terminal but it's not working.
Tried a couple of times, but sometimes the folder is created with a package.json file only. Then everything stopped downloading. What could be the issue?
Screenshot of the output in the terminal:
According to your screenshot, there is no problem when you initialize your react project.
I think your local network may not be good enough. To create a react app, you need to install many third-party nodes_modules then cause mistakes.
Therefore, you can try to change the npm source, such as taobao( https://registry.npm.taobao.org )
npm config set registry xxx
And then use the craete-react-app to initialize the app.

npx create-react-app my-app yield result 'create-react-app' is not recognized

I tried to use the 'npx create-react app [project name]' in my project folder but it produced this error
This happened after I deleted the create-react-app.cmd in my C:\Users[myname]\AppData\Roaming\npm folder.
I deleted the file because I had a different problem before where I used the same command but produced "module not found". So someone suggested me to delete the create-react-app.cmd file in my roaming/npm folder. even before doing this, I have tried uninstalling global create-react-app based on the create react app repo.
So was the deletion of create-react-app.cmd the cause to my problem? if so, what should I do to have that file back?
npx came with NPM, so with nodejs.
Uninstall and reinstall nodejs will fix the problem.
Add npm i create-react-app command before that command, and it will fix the problem.

Ant Design Cannot find module 'rc-textarea'

I just created an Umi Ant Design Pro project but when i run my project (yarn start),i am getting the following error:
Steps taken to resolve this issue:
1:installed rc-textarea:
yarn add rc-textarea
2:stopped my server and ran yarn again in my terminal
3:then ran yarn start to start my server and still got the same error although my terminal this time stopped displaying the error i keep getting in my browser as seen below:
Step4:I then did some Research and came across this link
Git Memory Blog
But the path : ./node_modules/antd/es/input/TextArea.js does not exist in my project.
I also found a github link with a similar issue:
GithubIssue
Other solutions did not work so i tried wbcs's solution:
yarn cache clean
yarn install
But the error is still eminent.
My inspection window indicates that this is a possible webpack issue:
How do i resolve this?
Try removing .umi and node_modules folders, and then start this project again.

Stuck with the installation of React.js

While installing React.js, I am getting stuck here. I've referred to the previous questions regarding the same. But couldn't find a solution. Even after uninstalling and reinstalling, I am unable to solve this issue. Also, I am not getting an index.js file after the installation. Someone guide me.
based on the image, you didn't go to the todo directory.
npx create-react-app todo
cd todo
npm start
Open an completly empty folder in a terminal and type npx create-react-app .

React Native "The expo SDK requires Expo to run. .... this code is not running on Expo."

I am coding with React Native. I don't see that when I first create react-native app for check running. When I implements my code see that. My purpose is generate apk.
app.json
build.gradle
index.js (index.android.json)
App package.json
Solved
Result: I solved my problem with npm install. I would like say many month after.
If anyone's getting this error after upgrading Expo, try restarting your simulator - that fixed it for me.
Here is my experience if someone using expo sees those error message.
I accidentally installed expo manually in my project which was version 29.0.0.
I was using version 28.0.0 of expo sdk, so it may have crashed inside.
What I did:
manually upgrade sdkVersion of app.json to 29.0.0.
change sdk version to 29.0.0 for react-native.
Had exactly the same error - fresh machine, fresh npm, only one version of expo installed.
Turns out, expo requires you to build it as an app before it can send it to the expo app properly (at least on Android). This is easiest done by:
Adding an "android" section to app.json, with the contents "package": "uk.co.yourcompany.yourpackagename" (this is required by android packages. It can be complete garbage, but should follow that format - a backwards domain name)
running expo build:android and following the instructions to sign up to expo's servers and build the app
then restarting expo start
Not sure if this is documented anywhere though, so may be a new thing?
Another thing to try is to move your node_modules folder away (or maybe delete it, up to you) and re-run npm install
According to the official tutorial: https://facebook.github.io/react-native/blog/2017/03/13/introducing-create-react-native-app.html
If you want to use expo in your application, you must create it in the following way
npm i -g create-react-native-app
create-react-native-app my-project
cd my-project
npm start
This will start the React Native packager and print a QR code. Open it in the Expo app to load your JavaScript.
as I see your code has files that are not necessary, such as build.gradle and index.js, the structure that create-react-native-app creates is different and easier to use
I was getting the same error after updating the expo-cli to version 3.0.6.
By looking at my package.json I noticed the expo-cli version installed on my computer is not the same as package.json. so I changed it to "expo-cli": "^3.0.6" and ran npm install || yarn, then the error disappeared!

Resources