因此,我试图运行reactjs官方教程,并使用第一行代码:
npx create-react-app react-tutorial...I得到以下错误:
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.*
发布于 2019-06-18 15:12:17
这个问题中似乎讨论了这个错误。
这似乎是一个亚恩问题。
解决办法是使用npm而不是纱线:
create-react-app myproject --use-npm如果使用npm安装,则会遇到以下错误:
国家预防机制错误!cb()从来没有打过电话!
通过更新(或删除)以下命令,增加.bashrc、.bash_profile和/或.profile中的ulimit:
ulimit -n 20000发布于 2019-06-18 15:05:05
看起来你用的是纱线而不是npm。试试这样的--use-npm标志:
npx create-react-app react-tutorial --use-npm发布于 2020-08-08 23:24:00
我通过安装yarn解决了这个问题,然后:
npx create-react-app my-app
cd my-app
npm start有些人卸载了yarn,转而使用了npm,我不知道为什么npm不适合我。
https://stackoverflow.com/questions/56651913
复制相似问题