Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create React App not installing, showing an error and aborting installation

I Reinstalled Node.js and Yarn. Now I am getting this error.

My environment information is:

Node: v8.12.0

NPM: 6.4.1

Yarn: 1.10.1

OS: Windows 10

PS C:\Users\mdbel\Desktop\Project\redux> npx create-react-app learnredux

Creating a new React app in C:\Users\mdbel\Desktop\Project\redux\learnredux.

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

yarn add v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.1.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\mdbel\\Desktop\\Project\\redux\\learnredux\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\mdbel\Desktop\Project\redux\learnredux has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
like image 923
Belal Avatar asked Oct 18 '18 20:10

Belal


People also ask

How do I fix create react error?

Use npx to solve the error "create-react-app: command not found", e.g. npx create-react-app my-app or install the package globally by running npm install -g create-react-app to be able to use the command without the npx prefix. The fastest way to solve the error is to use the npx command.

How do you fix you are running create react app 4.0 3 which is behind the latest release 5.0 0?

To solve the React. js error "You are running create-react-app 4.0. 3, which is behind the latest release (5.0. 0)", run the npx clear-npx-cache command and re-run your app creation command, e.g. npx create-react-app my-app .

How do you fix you are running create react app 5.0 0 which is behind the latest release 5.0 1?

How do you fix you are running create react App 5.0 0 which is behind the latest release 5.0 1? The solution that works for me: npm uninstall -g create-react-app. yarn uninstall -g create-react-app.


1 Answers

Once you have cleaned the yarn cache by running:

yarn cache clean

then subsequent calls to:

npx create-react-app your-app

will work.

like image 61
Ben Smith Avatar answered Sep 27 '22 20:09

Ben Smith