Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create-react-app throws error: "Missing dependencies in package.json"

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.*

like image 268
CommonSenseCode Avatar asked Mar 04 '23 20:03

CommonSenseCode


2 Answers

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
like image 187
mgarcia Avatar answered Apr 12 '23 14:04

mgarcia


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

npx create-react-app react-tutorial --use-npm
like image 35
prnsml Avatar answered Apr 12 '23 14:04

prnsml