gpt4 book ai didi

node.js - 在 Mac 上运行 react 时出现错误 : ENFILE: file table overflow, scandir

转载 作者:IT老高 更新时间:2023-10-28 23:02:12 34 4
gpt4 key购买 nike

我正在尝试在以下命令中在 mac osx 10.12.15 上安装和运行 Reaction

npm install -g react -cli react 初始化cd react react

然后我遇到了以下错误,我刚接触 Reactjs 开发人员,所以很紧张。而且它只是与软件包版本兼容,但我该如何解决这个问题

=> 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

最佳答案

这可能是由于 mac 上文件打开文件的限制。默认情况下,它设置为低。您需要增加默认大小。

$ 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

请参阅 link更多细节。

关于node.js - 在 Mac 上运行 react 时出现错误 : ENFILE: file table overflow, scandir,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45004352/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com