-2
PS F:\Programming Tutorials Videos\R Practice> npx create-react-app custom-hook
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\GALAXY COMPUTERS\AppData\Local\npm-cache\_logs\2023-01-06T17_33_28_552Z-debug-0.logtype here

I have installed node.js latest version but problem persist And with internet Connection I created React App Why is that, when I am not Connected to Internet it doesn't create React App

halfer
  • 19,824
  • 17
  • 99
  • 186
  • 3
    _"Why is that, when I am not Connected to Internet it doesn't create React App"_ - Because the files are being downloaded, and without an active connection it cannot download them. You can use a local npm registry, but that still requires an initial internet connection. – evolutionxbox Jan 06 '23 at 18:05
  • Are you using a proxy or VPN? Have you tried to ping `https://registry.npmjs.org/create-react-app` or use the URL on the browser to see if you can reach it? – acarlstein Jan 06 '23 at 18:06
  • Does this answer your question? [Do i need to always connect to internet when creating or working on react app?](https://stackoverflow.com/questions/60893434/do-i-need-to-always-connect-to-internet-when-creating-or-working-on-react-app) – Wyck Jan 06 '23 at 20:59

1 Answers1

0

When you use create-react-app with npx command it connect to your network and create new project that need to install dependencies on which your project depend on like react , react-dom etc hence it required network connection.

Harsh Mangalam
  • 1,116
  • 1
  • 10
  • 19
  • Even you have installed nodejs but to get other required packages it connect to network and fetch packages from npm – Harsh Mangalam Jan 06 '23 at 18:08
  • could you please tell me how to create-react-app without internet connection although I have installed all node.js and other necessary tools – Raees Kakar Jan 07 '23 at 05:18
  • You can use pnpm to reuse the installed packages from your local but first time it still required network connection to cache packages. – Harsh Mangalam Jan 07 '23 at 05:33