create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Can't install React-App

Open sinhaabhishek2000 opened this issue 3 years ago • 7 comments

Creating a new React app in E:\shopcart.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT npm ERR! network request to http://registry.npmjs.org/schema-utils failed, reason: Socket timeout 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\abhi\AppData\Local\npm-cache_logs\2022-04-27T11_45_58_092Z-debug-0.log

Aborting installation. npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json Deleting shopcart/ from E:
Done. npm ERR! code 1 npm ERR! path E:
npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-react-app "shopcart"

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\abhi\AppData\Local\npm-cache_logs\2022-04-27T11_45_47_614Z-debug-0.log

sinhaabhishek2000 avatar Apr 27 '22 11:04 sinhaabhishek2000

happened to me , revert to npm version 6.14.16.

EYOELTEKLE avatar Apr 27 '22 18:04 EYOELTEKLE

This is probably due to a network issue. Try reconnecting to your network and try again with a stable internet connection.

Saviourise avatar May 03 '22 12:05 Saviourise

This worked for me: I had node version 16.15.0 and I upgraded to version 18.1.0

Cyebukayire avatar May 14 '22 11:05 Cyebukayire

Not working for me.

My error are: Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template... npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! network Socket timeout 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\Md Rana\AppData\Roaming\npm-cache\_logs\2023-02-01T16_50_30_581Z-debug-0.log Aborting installation. npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed. Deleting generated file... node_modules Deleting generated file... package.json Deleting contact-app/ from E:\Practice\React

iamtheasad avatar Feb 01 '23 17:02 iamtheasad

i have this problem too

BagBear84 avatar Feb 10 '23 15:02 BagBear84

npx create-react-app amazon-clone -timeout=60000 I used it and fixed it.

iamtheasad avatar Jul 20 '23 01:07 iamtheasad

============================================================================================ Problem:

Creating a new React app in D:\assignment\Anchorblock-assignment\users-stack.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/tailwindcss: Socket timeout 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\moinu\AppData\Local\npm-cache_logs\2023-11-03T04_46_09_582Z-debug-0.log

Aborting installation. npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json Deleting users-stack/ from D:\assignment\Anchorblock-assignment Done.

============================================================================================ Solutions:

The error message you're encountering indicates a problem with npm being unable to fetch a package from the npm registry, likely due to network issues. Here's what you can do to troubleshoot and potentially resolve this issue:

  1. Check Your Internet Connection: Make sure that you have a stable internet connection and can access other websites and online resources without any issues.

  2. Clear npm Cache:

    • Run the following command to clear npm's cache:
      npm cache clean --force
      
    • This command will clear the npm cache, which can sometimes help in resolving network-related issues.
  3. Retry the Installation:

    • After clearing the cache, try running the create-react-app command again:
      npx create-react-app users-stack
      
  4. Use a Mirror:

    • If you suspect that the issue is related to npm's registry server, you can use a different registry mirror for your npm packages. The most popular one is the "npm.taobao.org" registry. You can switch to it using the following command:

      npm config set registry https://registry.npm.taobao.org/
      
    • After changing the registry, try running the create-react-app command again.

  5. Check for a Proxy Configuration:

    • If you are behind a corporate or network proxy, you may need to configure npm to use the proxy settings. You can do this by setting the proxy and https-proxy configurations in npm:
      npm config set proxy http://your_proxy_server:your_proxy_port
      npm config set https-proxy http://your_proxy_server:your_proxy_port
      
      Replace your_proxy_server and your_proxy_port with your actual proxy server information.
  6. Disable VPN or Firewall:

    • If you are using a VPN or firewall, it might be blocking the npm registry access. Try disabling them temporarily and see if the issue is resolved.
  7. Update npm:

    • Ensure that you are using an up-to-date version of npm. You can update

mdmoinulhossain avatar Nov 03 '23 05:11 mdmoinulhossain