Error: ENFILE: file table overflow, scandir while run reaction on Mac

陌路散爱 提交于 2020-11-30 02:49:31

问题


I'm trying to install and run Reaction on mac osx 10.12.15 within below command

npm install -g reaction-cli reaction init cd reaction reaction

Then I got below error I'm just fresh with Reactjs developer so it is simply nervously. And it simply compatible with the package version but how can i solve this problem

=> Started proxy.
=> Started MongoDB.
/Users/sopheak/.meteor/packages/templating-compiler/.1.3.2.1411czp++os+web.browser+web.cordova/plugin.compileTemplatesBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^
Error: ENFILE: file table overflow, scandir '/Users/sopheak/Documents/cam/react/reaction/packages/gridfs'
    at Error (native)
    at Object.fs.readdirSync (fs.js:808:18)
    at Object.wrapper (/tools/fs/files.js:1586:35)
    at readDirectory (/Users/sopheak/.meteor/packages/meteor-tool/.1.5.0.15auley++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:338:26)
    at Watcher._fireIfDirectoryChanged (/Users/sopheak/.meteor/packages/meteor-tool/.1.5.0.15auley++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:490:23)
    at /Users/sopheak/.meteor/packages/meteor-tool/.1.5.0.15auley++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:747:12
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/sopheak/.meteor/packages/meteor-tool/.1.5.0.15auley++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    at Watcher._checkDirectories (/Users/sopheak/.meteor/packages/meteor-tool/.1.5.0.15auley++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:736:7)
    at new Watcher (/Users/sopheak/.meteor/packages/meteor-tool/.1.5.0.15auley++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:435:10)
    at setupClientWatcher (/tools/runners/run-app.js:800:23)
    at [object Object]._.extend._runOnce (/tools/runners/run-app.js:811:7)
    at [object Object]._.extend._fiber (/tools/runners/run-app.js:890:28)
    at /tools/runners/run-app.js:417:12

回答1:


This is might be due to the limit on file open files on mac. By default it is set to low. You will need to increase the default size.

$ echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
$ echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -w kern.maxfiles=65536
$ sudo sysctl -w kern.maxfilesperproc=65536
$ ulimit -n 65536 

Refer this link for more details.



来源:https://stackoverflow.com/questions/45004352/error-enfile-file-table-overflow-scandir-while-run-reaction-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!