Cannot use create-react-app as it shows below error

Viewed 99

PS D:\Reactjs> npx create-react-app textutils

Creating a new React app in D:\Reactjs\textutils.

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

npm ERR! code FETCH_ERROR npm ERR! errno FETCH_ERROR npm ERR! invalid json response body at https://registry.npmjs.org/@typescript-eslint%2fscope-manager reason: Invalid response body while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fscope-manager: read ECONNRESET

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Ashes10\AppData\Local\npm-cache_logs\2022-08-22T05_43_38_991Z-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 textutils/ from D:\Reactjs Done.

3 Answers

Maybe this gonna work

npm cache clean --force

Might be because of the cache issue. To fix this, try the below command,

npm cache clean --force

If the issue still persists. Run the below command to install create-react-app,

npm install -g create-react-app

And then, Try creating your react application,

npx create-react-app appname

try to run the command line as administrator then

  • cd <your desired location to create the project>
  • npx create-react-app <project name>
Related