Stuck in making a react project - reactjs

guys. I'm having a trouble when using npx create-react-app script.
Whenever I try to create a react app, it's always show like this:
Creating a new React app in C:\USER\User\Document\GitHub\Projects
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
And it always stuck in there. I ever leave it for almost eight hours, but still it ain't work.
I've been trying to do npm install npm#latest -g to install the latest version of my npm, but still it doesn't work. I even have tried to uninstall the NodeJS in my computer, then reinstall it.
Earlier, I've always done my react projects with this method:
npm init
npm install create-react-app
npm create-react-app my-project
Unfortunately, after a week, I cannot do npm start for every react project that I've made before using that method. I also have tried to use the same method to create a new react project, but still it always stuck in the same part. I really need your help guys.
I'm using the latest version of VSCode on Windows 8.1 by the way.
Thank you in advanced.

Most likely you might be hosting an old version of create-react-app
Here are some processes for you to try out:
Uninstall the global version of create-react-app.
npm uninstall -g create-react-app
Run the following command to delete the create-react-app manually.
rm -rf /usr/local/bin/create-react-app
Now, you can use the npx create-react-app command to create a new app.

Related

trying to create a new react project by (create-react-app) it is not working properly

I installed latest version of node.js, react.js and next.js
Everything worked properly but at the point I try to create my react project folder in the terminal by create-react-app my-app it tells me this:
You are running create-react-app 5.0.0, which is behind the latest release (5.0.1).
We no longer support global installation of Create React App.
the problem began while I was already working on a project but one day when I did npm start
I got an error I couldn't solve so I decided to create a new project and then that happened did any one got this lately ?
Try to remove current version that you have locally and do it with latest version
npm uninstall -g create-react-app
npx clear-npx-cache
npx create-react-app#latest my-app
Uninstall create-react-app and run npx create-react-app#latest instead. Then you'll use the latest version of create-react-app

You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1). We no longer support global installation of Create React App

I am new to React and have been sitting with this problem for the whole day now, I installed nodejs a few weeks back but earlier updated to newest version as well. I have tried all the suggestions, clearing cache, deleting 'npm uninstall -g create-react-app
yarn global remove create-react-app' but nothing works.
If I type
npx create-react-app my-app that error keeps coming up and nothing works. Please help me
This solution worked for me
npm i create-react-app
I managed to figure it out, thanks
The problem you are having is because the react no longer supports the global installation of create react app. To solve this problem, run these commands:
1- npm uninstall -g create-react-app;
2- npm install -g create-react-app;
that's will upgrade your npx, then run:
npx create-react-app my-app
Hope this solves your problem.

Create-react-app not working even after uninstalling and reinstalling

I've been having difficulties getting create-react-app to work on my mac. I created a new project and simply tried "npx create-react-app my-app" and it told me that my version of create-react-app was outdated and to uninstall it with "npm uninstall -g create-react-app" but after doing that I literally get 1 file that was audited and its completed. Then when I go and try to install it again I keep getting the same error message. The furthest the install goes is installing the node_modules, package-lock.json, and package.json files then stops and lets me know that my create-react-app is outdated and to do the same command. Im in this never ending loop of uninstalling and reinstalling.
Obviously, I am doing something wrong here. I've even done these commands
npm cache clean --force
npm cache verify
npx clear-npx-cache to clear your npx cache.
npx create-react-app your-app
and still it tells me that my create-react-app is outdated. screenshot of my terminal
I'm relatively new to react development but I have definitely started react projects before with no issues.
I had this same issue happen as did another colleague of mine. For me, installing it locally with npm install create-react-app worked and for him he had to uninstall and reinstall node

Why can't I start a React project with npx?

I'm going in circles with npx trying to start a new project. Here's what I get:
"PS C:\Users\John\Documents\WebSites\react_projects> npx create-react-app material-ui
Need to install the following packages:
create-react-app
Ok to proceed? (y) y
"You are running create-react-app 4.0.3, which is behind the latest release (5.0.0).
"We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
npm uninstall -g create-react-app
yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/"
When I type npm uninstall -g create-react-app, I get "up to date, audited 1 package in 495ms. found 0 vulnerabilities."
So I try to create the app again with npx, and I get this:
"Need to install the following packages:
create-react-app
Ok to proceed? (y)"
So I press y, and I get the first error message again. I just go in circles. How can I fix this?
Refer to official reactjs website you need to have ""Node >= 14.0.0 and npm >= 5.6"" on your machine. https://reactjs.org/docs/create-a-new-react-app.html .
Also yarn create is available in Yarn 0.25+
so you might want to check these versions
npm
stands for node package manager. It helps to install, migrate apps by adding dependencies in package.json file. You only need to run npm i. For example in react API call npm i axios you should run and import in file in order to use axios features. Also all you need to have is package.json following dependencies and packages will be added(except node_modules folder as it comes with packages and more in size).
You can use npm to start, build, eject, watch and test.
npx is a CLI tool which provide way to install and manage dependencies hosted in npm registry. It is bundled with npm since 5.2.0v. It is helpful in installing and getting started with frontend JS libraries like reactjs, angularjs, vuejs, Sveltejs or boilerplate apps.

create-react-app bash: /usr/local/bin/create-react-app: No such file or directory

I had an origonal problem that I tried to fix and got another problem
1. ORIGONAL PROBLEM
I just tried to install a new react app using create-react-app and got this error first
Please note that global installs of create-react-app are no longer supported.
The node modules were installed but none of the other files or directories that normally install.
2. What I did to fix Origonal problem
on the react app website it https://create-react-app.dev/docs/getting-started/ it was suggested that I do the following (which I did)
"If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version."
I tried to run the command npm uninstall -g create-react-app but could not do it as my mac prevented it so ran sudo npm uninstall -g create-react-app
3. New PROBLEM
When I now run create-react-app I get the message
bash: /usr/local/bin/create-react-app: No such file or directory
TDI-MacBook-Air:Active bob$
What do I need to do to get create react App back. I am worried about messing up my installation more so am hesitant to go at it without some advice
Just simply run npx create-react-app app_name to create your app.
npx will fetch the latest version of create-react-app and setup your app.
This solved my error Just simply run npx create-react-app app_name to create your app. npx will fetch the latest version of create-react-app and setup your app.

Resources