You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only reference to that specific error I have found is this old issue on the Node 0.10 repo's. I have tried the 'fix' in that topic, namely increasing the open file references limit. That didn't work.
The issue occurs on both Node 4.4.7 and 6.3.1, on macOS Sierra 10.12 on a MBP 2015 15". Does anyone know what is going on here?
Reacted by Nikita Shenkman, Michael Czolko, Chance, kiranraj2k, Chris Anderson, Tomáš Horáček, Roman Gorodeckij, HyperSimon, Tommy Ruan, Frank Zhang and 1 more
We were able to get it to work by increasing the max file limit and moving to watchman v4.6.0
here are the steps we followed:
1. increase max file limt
# check open file limit
sysctl kern.maxfiles
# edit sysctl
sudo vim /etc/sysctl.conf
# add these two lines
kern.maxfiles=10485760
kern.maxfilesperproc=1048576
# reboot
sudo reboot
# check new file limit
sysctl kern.maxfiles
2. upgrade to watchman 4.6
# clone repo
git clone https://github.com/facebook/watchman.git
# change to master branch
git checkout -b v4.6.0 v4.6.0
# run compiler
./autogen.sh
./configure --enable-lenient --without-pcre --with-python
make
sudo make install
# check watchman version
watchman -v
# result should be 4.6.0
Reacted by Cosmin Nicula, Видул Петров, Ryan Callaghan, Daniel Lee, lauramelles, Plortinus, Fabian Bode, Zachary Zhang, Artem Arakcheev, Sabba Keynejad and 45 more
Reacted by Kirk Strobeck, natsu12, Vaughan Rouesnel, Sam Robinson and Nikollas Betiol
Reacted by elimau, Gio, Laura Gerhardt, Artem Arakcheev, jcrader, Tony Neel, John Choura Jr., Dimitri DO BAIRRO, Jose Bryan Montes Velazquez, Morgan Watson-Morris and 4 more
Reacted by jan-happy, Benjamin Marte, Rahul Jiresal, Kevin Bluer, Nicholas Haley, Joshua Raichur, alex, mirinzhang, Demian Alonso, Patrick Arminio and 37 more
Reacted by artforlife, Mike, Daniel Lee, Martin, Ante Barišić, Supriya Kalghatgi, Kirill Baldin, nooztv, John Choura Jr., Dimitri DO BAIRRO and 2 more
Reacted by Burak Aslan, Rick Lubbers, oelart505, Amir Sadoughi, Jackson Gross, Denis, ZucK, Benjamin Marte, FHY, Rahul Jiresal and 41 more
System doesn't report the updated value when i run sysctl kern.maxfiles (reports 300k) but upgraded to watchman 4.7.0 with brew install watchman and it seems to work
After updating to OSX Sierra and XCode 8.1, I cannot compile any of the React-Native projects. I get the error that the OP had. At this point, I have not been able to resolve it. You may consider re-opening the issue.
Here is what it looks like when I try to compile the Snowflake starter project:
@artforlife I'm having exact same issue although not related specifically to react-native, I'm in the process of updating to xcode 8.1 as after update to macOS sierra I was unable to run tests which depend on fs, any help appreciated...
EDIT: please look at this, installing watchman fixed this issue for me
@bondarewicz Thanks for the idea. I have just tried downgrading to Xcode 7.3.1 and the problem still persists. This leads me to think that it lies not with Xcode but elsewhere. Perhaps the Development Tools is the problem.
OSX: Sierra
XCode: 8.1
NodeJS: 5.1.0
Watchman: 4.6.0
kern.maxfiles: 10485760
I used to following steps to fix the issue.
Run watchman watch-list
Received the following error:
2016-10-30T18:24:39,064: [3239527360] the permissions on /usr/local/var/run/watchman/userman-state allow others to write to it. Verify that you own the contents and then fix its permissions by running chmod 0700 /usr/local/var/run/watchman/userman-state
Followed the instruction in the error prompt above and ran
Can confirm that this issue was related to tmux. After getting the error
2016-11-04 12:51 node[4311] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-11-04 12:51 node[4311] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1026:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
npm ERR! Test failed. See above for more details.
from running react-native commands, I installed watchman, but continued to get the issue. Running react-native commands outside of tmux now works. I do not have jest installed. None of the other fixes mentioned here had any effect.
I followed most of the steps above including upgrading watchman, and increasing the max file limit, but what solved it for me was verifying permissions by running watchman watch-list and then following the directions it provided. Thanks @OscarT and @hghinaglia!
updating watchman solved me the issue when i updated macOS Sierra
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:1036:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
Activity
deadlocked247 commentedon Aug 10, 2016
Just got this as well, also on sierra
mc13an commentedon Aug 10, 2016
me as well, also on sierra
mc13an commentedon Aug 10, 2016
Credit to @passwd for figuring this out
We were able to get it to work by increasing the max file limit and moving to watchman v4.6.0
here are the steps we followed:
1. increase max file limt
2. upgrade to watchman 4.6
deadlocked247 commentedon Aug 10, 2016
@mc-lean you're the best!!!
goldenice commentedon Aug 12, 2016
@mc-lean Nice! :)
Are there any plans to update watchman in the RN-repo so RN works out-of-the-box again?
mc13an commentedon Aug 12, 2016
@goldenice I would guess that it is. Sierra is due out in September so I would think they would plan to support it out of the box soon
aahlad-allari commentedon Aug 21, 2016
@mc-lean Thanks 👍
kjpolaszek commentedon Aug 29, 2016
Great, it works. 👍
zhaomiing commentedon Sep 6, 2016
thanks, you made my day :)
jalmaas commentedon Sep 13, 2016
System doesn't report the updated value when i run
sysctl kern.maxfiles(reports 300k) but upgraded to watchman 4.7.0 withbrew install watchmanand it seems to workmonder commentedon Sep 13, 2016
@jalmaas value updates only after reboot. Worked for me on GM.
But indeed, just updating to
watchman4.6.0+ seems to be enough.jalmaas commentedon Sep 13, 2016
it didn't update after reboot here
ide commentedon Sep 13, 2016
React Native works fine with relatively up-to-date software. These are the settings that are working for me:
lauborges commentedon Sep 13, 2016
unfortunately it does not work for me
11 remaining items
sammosampson commentedon Oct 28, 2016
i ran brew install automake but still can't compile watchman
artforlife commentedon Oct 30, 2016
@sammosampson What errors are you getting?
artforlife commentedon Oct 30, 2016
After updating to OSX Sierra and XCode 8.1, I cannot compile any of the React-Native projects. I get the error that the OP had. At this point, I have not been able to resolve it. You may consider re-opening the issue.
Here is what it looks like when I try to compile the Snowflake starter project:
Similar errors show up when compiling some tutorials I had laying around (they worked under Sierra and XCode 7.3.1)
bondarewicz commentedon Oct 30, 2016
@artforlife I'm having exact same issue although not related specifically to react-native, I'm in the process of updating to xcode 8.1 as after update to macOS sierra I was unable to run tests which depend on fs, any help appreciated...
EDIT: please look at this, installing watchman fixed this issue for me
artforlife commentedon Oct 30, 2016
@bondarewicz Thanks for the idea. I have just tried downgrading to Xcode 7.3.1 and the problem still persists. This leads me to think that it lies not with Xcode but elsewhere. Perhaps the Development Tools is the problem.
My watchman version is already 4.7.0 ...
bondarewicz commentedon Oct 30, 2016
@artforlife have you tried reinstall ? We need to debug this issue as many had the same problem but there is no definite answer yet...
artforlife commentedon Oct 30, 2016
@bondarewicz I have tried reinstalling the watchman, but that didn't affect anything.
artforlife commentedon Oct 30, 2016
I have the following configurations:
OSX: Sierra
XCode: 8.1
NodeJS: 5.1.0
Watchman: 4.6.0
kern.maxfiles: 10485760
I used to following steps to fix the issue.
watchman watch-listThis fixed it. To summarize, it seems to have been a permissions problem on a Watchman directory.
hbd commentedon Nov 18, 2016
Can confirm that this issue was related to tmux. After getting the error
from running react-native commands, I installed watchman, but continued to get the issue. Running react-native commands outside of tmux now works. I do not have jest installed. None of the other fixes mentioned here had any effect.
beshur commentedon Nov 23, 2016
Solved for me with updating Xcode and installing watchman with brew (which is not possible with 7.x Xcode)
edit
Also
sudo chown -R $(whoami) ~/cborchert commentedon Dec 1, 2016
I followed most of the steps above including upgrading watchman, and increasing the max file limit, but what solved it for me was verifying permissions by running
watchman watch-listand then following the directions it provided. Thanks @OscarT and @hghinaglia!abuammar commentedon Apr 20, 2017
updating watchman solved me the issue when i updated macOS Sierra
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:1036:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
jlampa commentedon Jul 3, 2017
Note that this is also what happens if you don't have Watchman installed at all.