0

I have installed nodejs then I tried to create react is app using npx create-react-app my-app but it just stuck in installing react-dom,cra-templates and then I tried npm also but it's the same please help need to learn react js please help I have node version v16.13.2. and npm version 8.1.2

PS D:\Programming\React Js> npx create-react-app firstapp

Creating a new React app in D:\Programming\React Js\firstapp.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
  • We can’t help without more information. Add the output, node version, npm version etc. If you can’t get it to work locally, you can look into online tools such as repl.it – JBallin Jan 29 '22 at 08:29
  • The issue may be the white space in the “React Js” folder. See https://stackoverflow.com/q/58354348/4722345 – JBallin Jan 30 '22 at 03:04
  • Also make sure you’ve uninstalled CRA globally using `npm uninstall -g create-react-app` – JBallin Jan 30 '22 at 03:05
  • Another thing to try is downgrading npm to 7 or 6. 8 is still pretty new. – JBallin Jan 30 '22 at 03:08
  • sir thank you but now its working i dont'know but after installing create-react-app globally its now downloading and thank you for helping – Jebash Developer Jan 30 '22 at 03:10
  • What fixed it? Maybe a new global install updated the CRA version? – JBallin Jan 30 '22 at 03:11
  • Have you tried using CRA at some point on your machine in the past? – JBallin Jan 30 '22 at 03:13
  • guys its not working first time its works but after installing some things its 163 packages need funding so cancel it again and when i tried it again its again stuck please help again sir – Jebash Developer Jan 30 '22 at 03:27
  • Sir please help sir it's not working now also I changed file name uninstall creatr-react app globally npx is latest 8.4 something and everything up to date – Jebash Developer Jan 30 '22 at 15:25
  • The output you see installing multiple packages and asking for funding etc means it’s working properly, you don’t need to cancel it. That being said you should be able to try again. So you uninstalled globally and the installation gets stuck again? – JBallin Jan 30 '22 at 18:07

2 Answers2

0

You can try to install globally, generally there are no more problems after. To install run this command

npm install -g create-react-app

Once installation successful, try running

npx create-react-app my-app
mvetois
  • 111
  • 11
  • CRA [discourages this](https://create-react-app.dev/docs/getting-started/#quick-start). – JBallin Jan 29 '22 at 08:22
  • sir i tried that also but when i enter npm install -g create-react-app its installs then says npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. changed 67 packages, and audited 68 packages in 34s 4 packages are looking for funding run `npm fund` for details 2 high severity vulnerabilities Some issues need review, and may require choosing a different dependency. Run `npm audit` for details. – Jebash Developer Jan 30 '22 at 02:49
  • sir now its worknig i was only seeing the error in npm but did'nt tried install npx again so i was confused now when i tried to install react-app using npx it works and thank you for helping me – Jebash Developer Jan 30 '22 at 03:13
  • The above output is not an error. It’s just information about the install and some warnings. – JBallin Jan 30 '22 at 03:16
  • Ironically this advice was the cause of your problem and you’ll have the same problem again in the future. See my answer. – JBallin Jan 30 '22 at 03:17
  • guys its not working first time its works but after installing some things its 163 packages need funding so cancel it again and when i tried it again its again stuck please help again sir – Jebash Developer Jan 30 '22 at 03:25
0

You likely have a global installation of create-react-app which is not the latest version. Uninstall it using npm uninstall -g create-react-app.

The CRA docs recommend uninstalling the global version in their very first steps:

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 or yarn global remove create-react-app to ensure that npx always uses the latest version.

JBallin
  • 8,481
  • 4
  • 46
  • 51