Error when running watchman
Asked Answered
B

10

23

When I run react-native start, I am getting the following message

Error: A non-recoverable condition has triggered. Watchman needs your help! The triggering condition was at timestamp=1489123194: inotify-add-watch(/var/www/html/eventManager/android/app/src/main/res/mipmap-mdpi) -> 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

at ChildProcess.<anonymous> (/var/www/html/bookLister/node_modules/fb-watchman/index.js:207:21)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Socket.<anonymous> (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:492:12)
Burkitt answered 10/3, 2017 at 5:37 Comment(4)
are you running in device or emulator?Captious
Check this answer given by me it can solve your problem.Captious
yes I am using emulatorBurkitt
https://mcmap.net/q/505062/-npm-err-failed-at-the-email-160-protected-start-script-39-react-native-start-39 check this outCaptious
B
51
echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

watchman shutdown-server

This one helped

Burkitt answered 10/3, 2017 at 7:14 Comment(5)
Happy to hear @DamianLatteneroBurkitt
Thanks, it helped.Shuster
It worked for me as well. But I need to enter these commands every time I reset my computer. Is there any permanent way to do it?Nicky
@Nicky The answer by mad_greasemonkey here will solve the problem permanently. I tried on my computer and next time when I start computer the error doesn't occur.Pullman
Thanks for this post. It helps me but each time I reboot my system I should run these lines! What should I do for solve this for ever on my system?!Kort
R
6

Just run these commands in terminal:

echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
watchman shutdown-server  

Other Way make Script in package.json

"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "flow": "flow",
    "flow-stop": "flow stop",
    "watch-need-help": "echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && watchman shutdown-server"
  },

Run following command on Terminal in project directory

npm run watch-need-help
Refute answered 9/12, 2017 at 11:9 Comment(0)
P
6

It works for me

watchman watch-del-all
watchman shutdown-server

Here is link which I follow.

Patriciate answered 7/12, 2021 at 0:18 Comment(1)
It worked for me, but add watchman watch-project '[my project path]' at the end.Moribund
N
5

Increase inotify limit to increase the limit on the number of files you can monitor.

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p

Please go through this for more info

Nonsuch answered 15/7, 2019 at 4:38 Comment(0)
H
3

This One is Also Helpfull .

echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches  && echo 999999 | sudo tee -a  /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee  -a /proc/sys/fs/inotify/max_user_instances && watchman  shutdown-server
Hearttoheart answered 23/5, 2018 at 6:45 Comment(0)
V
1

updating

watchman

to latest(4.7.0) version helped me solve this problem.

Venturous answered 25/7, 2017 at 17:16 Comment(0)
K
1

this one helped found it on github issues

echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server && sudo sysctl -p

https://github.com/facebook/watchman/issues/163 by @eladcandroid [1]

Karlee answered 1/3, 2022 at 5:59 Comment(0)
D
0

You can solve it by trying one of the below solutions:

first pass hit line of code in your terminal and test it :

echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches  && echo 999999 | sudo tee -a  /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee  -a /proc/sys/fs/inotify/max_user_instances && watchman  shutdown-server

or try to use "react-native run-android" or "run-ios" in the root of your project and then (in other terminal) "react-native start"

otherwise perhaps the debugger page was left open from previous sessions. Closing the tab completely and then opening the debugger in a new tab solved the issue.

if none of the above solution doesn't work with you try to restart your PC

Diandre answered 8/10, 2020 at 14:19 Comment(0)
A
0

i faced the same problem even after reinstalling watchman using homebrew: after deleting the pid, log and sock files, the following steps worked for me:

  • touch pid && touch log && touch sock
  • watchman --foreground --logfile=/dev/stdout
  • Allowed accessibility permissions : sudo chmod 700 /usr/local -closed all terminals and re-runned my commands. That should help.
Affective answered 4/12, 2022 at 15:11 Comment(0)
P
0
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server && sudo sysctl -p

This command should resolve this error.

Prepuce answered 4/12, 2023 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.