gpt4 book ai didi

visual-studio-code - Visual Studio 代码 : Unable to watch for file changes. 为什么?

转载 作者:行者123 更新时间:2023-12-03 23:54:18 25 4
gpt4 key购买 nike

我经常收到“Visual Studio Code 无法观察这个大工作区中的文件更改”的错误消息,我不知道为什么。

Visual Studio Code (Linux): 1.24.1

我的排除设置是:
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.svn/**": true,
"**/dist/**": true,
"**/dist-prod/**":true
}

该项目的结构是:
angular.json
/dist
/dist-prod
/e2e
ngsw-config.json
/node_modules
package.json
package-lock.json
proxy.conf.json
README.md
/src
tsconfig.json
tslint.json
xliffmerge.json
.editorconfig
.gitignore
/.svn

/src 仅包含 167 个文件和文件夹。我怀疑 node_modules 并没有真正被排除在外。但我不能确定。我的设置正确吗?

重新启动 VSC 后问题消失了,但过一段时间总是会出现...

最佳答案

你必须增加限制。请按照以下步骤操作:

  • 检查电流限制 cat /proc/sys/fs/inotify/max_user_watches
  • 在 vim 编辑器中编辑 sysctl.conf 文件 sudo vim /etc/sysctl.conf
  • 在底部添加此行 fs.inotify.max_user_watches=524288
  • 保存 (ESC) :wq!
  • 加载更改 sudo sysctl -p
  • 现在再次检查cat /proc/sys/fs/inotify/max_user_watches

  • 如果计数相同,则执行以下命令
    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

    For more details

    快乐编码:)

    关于visual-studio-code - Visual Studio 代码 : Unable to watch for file changes. 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51647079/

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