Search code examples
reactjscreate-react-app

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 > fsevents@2.0.6: 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.*


Solution

  • 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