【问题标题】:unable to start server , npm start gives error无法启动服务器,npm start 给出错误
【发布时间】:2020-11-01 22:04:22
【问题描述】:

我尝试使用 npm start 启动开发服务器

所有安装程序均按照https://facebook.github.io/react-native/docs/getting-started上的说明进行

我收到如下错误:

/home/akash/appme中寻找JS文件

加载依赖图...internal/fs/watchers.js:173 抛出错误; ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/akash/appme/node_modules/jest-jasmine2/node_modules'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1270:11)
    at NodeWatcher.watchdir (/home/akash/appme/node_modules/sane/src/node_watcher.js:159:22)
    at Walker.<anonymous> (/home/akash/appme/node_modules/sane/src/common.js:109:31)
    at Walker.emit (events.js:200:13)
    at /home/akash/appme/node_modules/walker/lib/walker.js:69:16
    at go$readdir$cb (/home/akash/appme/node_modules/graceful-fs/graceful-fs.js:162:14)
    at FSReqCallback.oncomplete (fs.js:153:23) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/akash/appme/node_modules/jest-jasmine2/node_modules',
  filename: '/home/akash/appme/node_modules/jest-jasmine2/node_modules'
}

【问题讨论】:

    标签: react-native watchman


    【解决方案1】:

    它达到了您系统的文件观察者限制

    试试echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf &amp;&amp; sudo sysctl -p

    来源:https://github.com/gatsbyjs/gatsby/issues/11406#issuecomment-458769756

    【讨论】:

    【解决方案2】:

    在 VSCode 中尝试编辑 setting.json 文件 --> 首选项 --> 设置 --> 打开设置

    并排除特定的工作区目录,例如

    "files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/*/**": true
    

    }

    来源:https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc

    【讨论】:

      猜你喜欢
      • 2020-12-21
      • 2020-08-23
      • 2015-08-19
      • 1970-01-01
      • 1970-01-01
      • 2017-03-21
      • 2022-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多