1

我正在尝试在 Fedora 26 中使用 React Native,直到那时我一直遵循facebook 教程。

一切进展顺利,直到我尝试使用 npm 启动应用程序

npm 开始

并收到此错误:

> cardbook@0.1.0 start $HOME/cardbook
> react-native-scripts start

9:31:54 AM: Starting packager...
***ERROR STARTING PACKAGER***
Starting React Native packager...
Scanning 770 folders for symlinks in $HOME/cardbook/node_modules (19ms)
Loading dependency graph.
Running packager on port 19001.


jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1507206724: inotify-add-watch($HOME/cardbook/node_modules/react-native-maps/lib/android/lib/build/tmp/expandedArchives/classes.jar_6745ow7srqaaq6vs8k7dkn33k/com/google/android/gms/common/data) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.

附加信息:

  • 守望者版本:4.9.0
  • npm 版本:3.10.10

任何纯洁善良的灵魂能帮助我吗?

4

2 回答 2

1

我现在正在手机上运行我的应用程序。我采用了启发式方法,试图快速解决问题,但信息非常缺乏。反正我是这样解决的:

首先我卸载了守望者:

$ sudo make uninstall

所以使用 yarn(注意我没有使用 npm,它仍然不起作用),我收到了以下提示:

yarn start
yarn run v1.1.0
$ react-native-scripts start
11:15:08 AM: Unable to start server
  See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
    sudo sysctl -w fs.inotify.max_user_instances=1024
    sudo sysctl -w fs.inotify.max_user_watches=12288
error Command failed with exit code 1.

显然我遵循了以下说明:

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288

并成功收到我的二维码。

于 2017-10-05T15:07:35.453 回答
0

如果您不想安装 Watchman,只需键入以下命令即可修复它

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288
于 2018-08-07T11:23:20.033 回答