Reactjs create react应用程序抛出错误:";package.json中缺少依赖项;

Reactjs create react应用程序抛出错误:";package.json中缺少依赖项;,reactjs,create-react-app,Reactjs,Create React App,因此,我尝试运行reactjs官方教程,并使用第一行代码: npx create-react-app react-tutorial …我得到以下错误: 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, re

因此,我尝试运行reactjs官方教程,并使用第一行代码:

 npx create-react-app react-tutorial
…我得到以下错误:

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
我读过一些关于在其他地方清理或强制清理npm缓存的文章,但这也不起作用:

npm cache clean --force       

我在ubuntu上运行最新的节点(10.16.0),我也尝试了8.*

看起来你使用的是纱线而不是npm。尝试
——像这样使用npm
标志:

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

这一错误似乎在以下章节中进行了讨论:

这似乎是一个虚构的问题

解决方法是使用npm代替纱线:

create-react-app myproject --use-npm
如果使用npm安装,您会遇到以下错误:

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
npm错误!我从没打过电话

通过更新(或删除)以下命令,增加.bashrc、.bash_配置文件和/或.profile中的ulimit:

ulimit -n 20000

我通过安装
纱线
修复了此问题,然后:

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

有些人卸载了
warn
并使用了
npm
,我不知道为什么
npm
对我不起作用。

尝试升级系统上的npm版本。 还要将node.js版本升级到最新版本