5

So I'm trying to run reactjs official tutorial and with the first line of code:

 npx create-react-app react-tutorial

...I get the following error:

npx: installed 91 in 12.692s

Creating a new React app in /home/foo/projects/react-tutorial.

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

yarn add v1.12.3
[1/4] Resolving packages...
warning react-scripts > [email protected]: Please update: there are crash fixes
[2/4] Fetching packages...
[-----] 1/1297Missing dependencies in package.json

I read some where else to clean or force clean npm cache but that didn't work either:

npm cache clean --force       

I'm on ubuntu running latest node (10.16.0) I also tried with 8.*

5 Answers 5

6

It seems that the error is discussed in this issue:

This seems to be a Yarn issue.

The workaround is to use npm instead of yarn:

create-react-app myproject --use-npm

If installing with npm you experience the following error:

npm ERR! cb() never called!

increase the ulimit in your .bashrc, .bash_profile, and/or .profile by updating (or removing) the below command:

ulimit -n 20000
Sign up to request clarification or add additional context in comments.

Comments

1

Looks like you are using yarn instead of npm. Try --use-npm flag like this :

npx create-react-app react-tutorial --use-npm

Comments

1

I fixed this issue by installing yarn and then:

npx create-react-app my-app
cd my-app
npm start

Some people uninstalled yarn and used npm instead, I am not sure why npm did not work for me.

Comments

1

Try to upgrade npm version on your system. Also upgrade your node.js version to the latest one.

Comments

0

I have solved this issue here all steps are written look into it.. reinstall npm(react) using the following command npm install -g npm-reinstall to some users, it may ask to audit fix do it npm audit fix npm audit fix --force after it will take 2-5 min then write our command for creating a new project in react using npm npx create-react-app amazon --use-npm After the common step to start the server cd amazon npm start

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.