Skip to content

Instantly share code, notes, and snippets.

@yeomann
Last active March 4, 2019 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yeomann/a78513336a91a887b5600b4e16c82530 to your computer and use it in GitHub Desktop.
Save yeomann/a78513336a91a887b5600b4e16c82530 to your computer and use it in GitHub Desktop.
Vscode unable to watch for file changes in large workspace - Ubuntu 18+
First we can check the current limits etc by following:
```
echo "MAX file watches allowed on system"
cat /proc/sys/fs/inotify/max_user_watches
echo "Current files in project - excluding node_modules"
find . -type f -not -path '**/node_modules/**' | wc -l
echo "Current files in project - including node_modules"
find . -type f | wc -l
```
and in order to increase, use following:
```
sudo /bin/su -c "echo 'fs.inotify.max_user_watches=524288' >> /etc/sysctl.conf"
sudo sysctl -p
```
verfiy again using `cat /proc/sys/fs/inotify/max_user_watches`
I think it's a good idea to add some watcherExclude object in the vscode user settings
```
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/node_modules/*/**": true,
"**/Pods/**": true,
"**/dist/**": true
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment