Abubaker_amin
Abubaker_amin

Reputation: 11

I'm getting this error while installing react js in VS code

$ npx create-react-app my-project

Creating a new React app in D:\react\my-project.

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/eslint-plugin-jsx-a11y: 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\Lenovo\AppData\Local\npm-cache\_logs\2022-02-28T07_59_07_158Z-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 my-project/ from D:\react
Done.

Upvotes: 1

Views: 1455

Answers (2)

Irene ntungwe
Irene ntungwe

Reputation: 1

  1. you can try this please. I had a similar issue

    1.npm uninstall -g create-app

    2.npm uninstall crate react-app

    3.npx create-react-app (app name of your choice)

Upvotes: 0

James Oyanna
James Oyanna

Reputation: 11

I think you are trying to create a react application using the create-react-app not that you are installing react on vscode. Maybe you may need to reframe the question.

Meanwhile, here is why you are having that error - By running the create-react-app, you are trying to fetch and download modules, dependencies from the npm registry to your computer.

npm is failing to fetch those modules because your internet may be disconnected.

There could be a problem with your internet connection. Ensure it's working, try another one or increase npm fetch timeout.

Upvotes: 1

Related Questions