For some reason when trying to create a new app using create react app, it results in errors everytime. Anybody know what's going on?
Error Stack
Have you tried it without the additional --use-npm flags at the end?
npx create-react-app user-onboarding
cd user-onboarding
npm start
Official docs
Edit: Yeah, reading your errors in the screenshot it appears that the --use-npm flag is causing it to use npm which has outdated versions available, but npx always finds the newest versions. Which is a big reason it is the preferred method for installing create-react-app
If you have your heart set on using npm you can always do an npm update before running it again.
Related
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.
I've tried to create a new React App with every command from the official documentation
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
But I got every time the same result as shown here:
I tried to fully uninstall and reinstall Node.js; lower versions; I passed from 64bit to 32bit; tried to see if there was some conflicts but still nothing. Every suggestion will be loved
I fixed it by running this command:
npm audit fix --force
I had the same issue when I tried to run it with node v18... The only thing that worked was to use some previous version. If you're trying with v18, try to downgrade and see if it would work.
When intially installing a npx create-next-app#latest or npx create-next-app#latest --typescript complete the install and then try running with next dev I see a useContext error.
I haven't touched any files and am just trying to run bare bones but yet I'm seeing this error, I even search for useContext in vs code search and nothing is found.
Wondering if I'm the only one who is experiencing this.
i run cmd npx create-next-app#latest --ts is all right,i guess y maybe at that time network is bad
enter image description here
I can't do create-react-app my-app. I keep getting that error.. I don't know what's wrong
i actually cleared my npm cache and everything became fine
You will be able to resolve by force clearing the cache.
If it's not working then delete everything from C:\Users\[username]\AppData\Roaming\npm-cache
You can also create react application by following command.
npx create-react-app demo-react
I'm getting a React Native version mismatch.
JavaScript version: 0.51.0
Native version: 0.52.0
I know there are others who have posted similar online but I simply don't understand what I need to do to resolve it, and as I'm supposed to avoid asking for help in other posts I am starting a new one!
I've closed Terminals and run build again as suggested elsewhere, considered changing Expo versions but unsure if I need to, and how. Anyone got a simply-to-explain solution?
Which version of what do I need to change?
Thanks
The issue of mismatch is related to the changing of your react-native version without properly updating peer dependencies and native projects.
If your project is using Expo, try following the upgrade guidelines here offered from Facebook.
Upgrading to new React Native versions
Found under.. "Create React Native App projects"
The document reference in will give you working mappings.
Once updated, run in your project root.
npm prune && npm install
# OR
yarn
Afterward start your app with your cache cleared.
npm start --reset-cache
# or
yarn start --reset-cache