React Native — запуск npm не запускается

Я пытаюсь работать с React Native в Fedora 26 и следую руководство по Facebook до тех пор.

Все шло очень хорошо, пока я не попытался запустить приложение с помощью npm.

запуск нпм

И получить эту ошибку:

> [email protected] 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
  • версия нпм: 3.10.10

Может ли какая-нибудь чистая и добрая душа помочь мне?


person Felix    schedule 05.10.2017    source источник


Ответы (2)


Я запускаю свое приложение прямо сейчас на своем телефоне. Я следовал эвристическому подходу, пытаясь решить проблему быстро, тогда есть большая нехватка информации. Во всяком случае, я решил это так:

Сначала я удалил сторожа:

$ sudo make uninstall

Итак, с пряжей (обратите внимание, я не использовал 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

И успешно получил свой QR-код.

person Felix    schedule 05.10.2017

Просто введите следующие команды, чтобы исправить это, если вы не хотите устанавливать Watchman

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288
person Selmi Karim    schedule 07.08.2018
comment
Спасибо! Но я уже делал это. Это была заключительная часть моего ответа :) - person Felix; 25.03.2020