react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Packager fails on macOS 10.12 Sierra

Open goldenice opened this issue 10 years ago • 38 comments

I have upgraded to the macOS Sierra beta yesterday, and the React Native Packager seems to fail. I've tried to reinstall the dependencies, but no use.

The output of the packager is this:

[11:45:02 AM] <START> Building Dependency Graph
[11:45:02 AM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot

React packager ready.

2016-08-09 11:45 node[6397] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-08-09 11:45 node[6397] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-08-09 11:45 node[6397] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
 ERROR  watch null EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"watch null","filename":null}
Error: watch null EMFILE
    at exports._errnoException (util.js:873:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1217:21)

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?

goldenice avatar Aug 09 '16 09:08 goldenice

Just got this as well, also on sierra

deadlocked247 avatar Aug 10 '16 12:08 deadlocked247

me as well, also on sierra

mc13an avatar Aug 10 '16 16:08 mc13an

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

# 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

mc13an avatar Aug 10 '16 18:08 mc13an

@mc-lean you're the best!!!

deadlocked247 avatar Aug 10 '16 19:08 deadlocked247

@mc-lean Nice! :)

Are there any plans to update watchman in the RN-repo so RN works out-of-the-box again?

goldenice avatar Aug 12 '16 10:08 goldenice

@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

mc13an avatar Aug 12 '16 16:08 mc13an

@mc-lean Thanks 👍

aahlad-allari avatar Aug 21 '16 10:08 aahlad-allari

Great, it works. 👍

kjpolaszek avatar Aug 29 '16 22:08 kjpolaszek

thanks, you made my day :)

zhaomiing avatar Sep 06 '16 17:09 zhaomiing

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

jalmaas avatar Sep 13 '16 13:09 jalmaas

@jalmaas value updates only after reboot. Worked for me on GM.

But indeed, just updating to watchman 4.6.0+ seems to be enough.

monder avatar Sep 13 '16 14:09 monder

it didn't update after reboot here

jalmaas avatar Sep 13 '16 14:09 jalmaas

React Native works fine with relatively up-to-date software. These are the settings that are working for me:

$ node --version
v6.5.0
$ watchman --version
4.6.0
$ sysctl kern.maxfiles
kern.maxfiles: 16384
$ sysctl kern.maxfilesperproc
kern.maxfilesperproc: 10240

ide avatar Sep 13 '16 19:09 ide

unfortunately it does not work for me

macOS 10.12 (16A319)

$ node --version
-> v6.5.0
$ watchman --version
-> 4.6.0
$ sysctl kern.maxfiles
-> 10485760
$ sysctl kern.maxfilesperproc
-> 1048576
React packager ready.

2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-13 17:10 node[8707] (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:1026:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

lauborges avatar Sep 13 '16 20:09 lauborges

Isn't working for me 👎

Versions:

$node --version
v6.6.0

$watchman --version
4.7.0

$sysctl kern.maxfiles
kern.maxfiles: 10485760

$sysctl kern.maxfilesperproc
kern.maxfilesperproc: 1048576

Log:

2016-09-19 15:25 node[989] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-19 15:25 node[989] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-19 15:25 node[989] (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:1036:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

hghinaglia avatar Sep 19 '16 20:09 hghinaglia

This worked perfectly for me. Thanks!

mager avatar Sep 20 '16 16:09 mager

Upgrading watchman solved the issue for us.

InYourDreamz avatar Sep 22 '16 03:09 InYourDreamz

No luck :(

sri-rang avatar Sep 22 '16 15:09 sri-rang

Upgrading watchman worked, brew didn't cooperate but heh..

$ git clone https://github.com/facebook/watchman.git
$ cd watchman
$ git checkout v4.7.0  # the latest stable release
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

sri-rang avatar Sep 22 '16 16:09 sri-rang

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.

oscardemoya avatar Sep 22 '16 19:09 oscardemoya