Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native run-android fails Error watch

I am having trouble figuring out the cause of the issue.

I start the server with npm start I deploy the code and reverse the adb to a physical device with react-native run-android.

i get the following error on the server . What is the possible fix ? Any solution is highly appreciated

ERROR  watch /home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/fbjs-scripts/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify ENOSPC
{"code":"ENOSPC","errno":"ENOSPC","syscall":"watch /home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/fbjs-scripts/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify","filename":"/home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/fbjs-scripts/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify"}
Error: watch /home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/fbjs-scripts/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify ENOSPC
    at exports._errnoException (util.js:870:11)
    at FSWatcher.start (fs.js:1234:19)
    at Object.fs.watch (fs.js:1262:11)
    at NodeWatcher.watchdir (/home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/sane/src/node_watcher.js:144:20)
    at Walker.<anonymous> (/home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/sane/src/node_watcher.js:353:12)
    at emitTwo (events.js:87:13)
    at Walker.emit (events.js:172:7)
    at /home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/sane/node_modules/walker/lib/walker.js:69:16
    at /home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/graceful-fs/graceful-fs.js:142:16
    at /home/pichate/projects/react/ReactNative/ReactNative/NF/node_modules/react-native/node_modules/graceful-fs/graceful-fs.js:142:16
like image 354
Pichate Buakaew Avatar asked Sep 28 '26 05:09

Pichate Buakaew


1 Answers

This may be the problem with watchman. It has watched too many files. If it is, cancel the limit Without using watchman, this can be fixed by the below command. In terminal run the command:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
like image 54
iPragmatech Avatar answered Sep 30 '26 18:09

iPragmatech