我正在尝试解决项目执行中的问题。运行 yar dev 命令时,出现以下错误:

I'm trying to solve a problem in the execution of my project. When running the yar dev command the following error appears:

提问人:bruno adller 提问时间:11/9/2023 最后编辑:journpybruno adller 更新时间:11/11/2023 访问量:32

问:

运行 yarn dev 时,加载页面时总是给出相同的错误。我已经尝试使用 Yarn Upgrade、Yarn Add Yarn 和 Yarn Dev 运行它,但它没有运行:

错误:

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/bruno-adller/projects/frontend/node_modules/moment/src/lib/units/aliases.js'
    at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
    at Object.watch (node:fs:2343:34)
    at createFsWatchInstance (/home/bruno-adller/projects/frontend/node_modules/chokidar/lib/nodefs-handler.js:119:15)
    at setFsWatchListener (/home/bruno-adller/projects/frontend/node_modules/chokidar/lib/nodefs-handler.js:166:15)
    at NodeFsHandler._watchWithNodeFs (/home/bruno-adller/projects/frontend/node_modules/chokidar/lib/nodefs-handler.js:331:14)
    at NodeFsHandler._handleFile (/home/bruno-adller/projects/frontend/node_modules/chokidar/lib/nodefs-handler.js:395:23)
    at NodeFsHandler._addToNodeFs (/home/bruno-adller/projects/frontend/node_modules/chokidar/lib/nodefs-handler.js:637:21) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/bruno-adller/projects/frontend/node_modules/moment/src/lib/units/aliases.js',
  filename: '/home/bruno-adller/projects/frontend/node_modules/moment/src/lib/units/aliases.js'
}
error Command failed with exit code 1.

info 有关此命令的文档,请访问 https://yarnpkg.com/en/docs/cli/run

运行 yarn dev 时,加载页面时总是给出相同的错误。我已经尝试使用 Yarn Upgrade、Yarn Add Yarn 和 Yarn Dev 运行它,但它没有运行:

运行项目时,它会加载但随后停止,并出现上述错误,并且网站无法打开。

JavaScript ReactJS Webpack Babeljs yarn-lock.json

评论

1赞 Aaron 11/11/2023
这回答了你的问题吗?React Native 错误:ENOSPC:已达到文件观察者数量的系统限制

答:

1赞 liaifat85 11/11/2023 #1

引发此错误的原因是系统监视的文件数已达到限制。您可以查看此处给出的解决方案。React Native 错误:ENOSPC:已达到文件观察者数量的系统限制