无法启动服务器,npm start给出错误

时间:2019-06-14 12:51:38

标签: react-native watchman

我试图使用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'
}

2 个答案:

答案 0 :(得分:1)

达到系统文件查看器的限制

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

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

答案 1 :(得分:0)

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

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

SELECT 1 WHERE false

}

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