Last active
March 4, 2019 16:29
-
-
Save yeomann/a78513336a91a887b5600b4e16c82530 to your computer and use it in GitHub Desktop.
Vscode unable to watch for file changes in large workspace - Ubuntu 18+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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