'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.*
Solution 1:[1]
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
Solution 2:[2]
Looks like you are using yarn instead of npm. Try --use-npm
flag like this :
npx create-react-app react-tutorial --use-npm
Solution 3:[3]
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.
Solution 4:[4]
Try to upgrade npm version on your system. Also upgrade your node.js version to the latest one.
Solution 5:[5]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | mgarcia |
Solution 2 | prnsml |
Solution 3 | David Buck |
Solution 4 | Anubhav Tyagi |
Solution 5 | Dharmesh Vala |