react-native: MacOS Sierra Error with EMFILE upon NPM start
just upgraded to Sierra and am running into a problem when i enter NPM start
For background, I am on react-native 0.26 and unfortunately cannot upgrade at the moment. I also do not have brew
My logs show the following when I try NPM start:
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-21 12:35 node[1515] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
ERROR Error watching file for changes: EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename":null}
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:953:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1400:11)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 36
- Comments: 30 (2 by maintainers)
I’d like to add that I’ve been running the packager without watchman for 3-4 months because React Native’s Node packager doesn’t depend on watchman. However, after upgrading to macOS Sierra the Node packager started failing with the above errors. Installing the current version of watchman (
brew install watchman
) did solve the issue for me, but something obviously regressed and it would be good to understand what that is.The problem can be solved by reinstalling react-native-cli:
I was checking watchman issues and found out this one: https://github.com/facebook/watchman/issues/358
When running
watchman watch-list
I got some permissions error.chmod 0700 /usr/local/var/run/watchman/<USER>-state
worked for me.brew install watchman
solved it for me but had to update xcode to 8.1 also in order to install watchman.This answer(facebook/react-native#9309) work to me. I create and eidt new
sysctl.conf
and install watchman through homebrew.1. increase max file limt
2. upgrade to watchman 4.6
Installing watchman worked for me.
@gnestor needed to install watchman - thanks!
I reinstall node, watchman, npm and etc, finally everything goes fine! I think new updates about supporting mac OS Sierra were included in the package.
brew install node
brew install watchman
brew link automake pcre
npm install -g react-native-cli
export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}
react-native run-android
@bbb324 Could you try install watchman by homebrew
brew install watchman
worked for me.If you are still getting this error and are using tmux on MacOS Sierra, try open a new terminal without tmux and run ‘watchman version’. After doing that, it was fixed for me within tmux.
@Luavis holy cow after 2-3 hours of searching, setting kern.maxfiles! Never would have got it. Thank you!
Have you checked the solutions in https://github.com/facebook/react-native/issues/9309?
@Luavis i install watchman by homebrew thanks!!
Just FYI, I did not change the kern maxfiles, I only installed watchman.
perhaps there are two separate issues here - the project that I am building is pretty small and simple at the moment.
Thanks to @Luavis , I followed his steps, still resulted in failure. In my case, need another operation that mentioned below: https://github.com/facebook/react-native/issues/910#issuecomment-94181845
@Luavis still didn’t work, when I execute ./autogen.sh
resolved via: https://github.com/leecade/rn-notes/issues/21