"yarn start" 对于 React Native 应用程序失败 "Unable to start server"

"yarn start" for React Native app fails with "Unable to start server"

当我在我的 React Native 应用程序项目文件夹中执行 yarn start 时,出现此错误:

yarn run v1.3.2
$ react-native-scripts start
21:58:08: Unable to start server
See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

在我执行了两个命令后 - sudo sysctl -w kern.maxfiles=5242880sudo sysctl -w kern.maxfilesperproc=524288 - 从错误消息中 yarn start 工作正常。