I am working on a project on WSL 2 in windows. The project uses node to only compile sass and minify js. I have saved the project files on my Windows File System. I access the project files and run the project using Ubuntu on WSL 2. Everything works fine except gulp watch. I use VSCode as text editor. I have configured gulp watch properly to recompile sass files on changes but it does not seem to do that. On running the gulp watch, watch starts but on making any change, the SASS files are not compiled.
Asked
Active
Viewed 1,345 times
1
-
Does this answer your question? [How can nodemon be made to work with WSL 2?](https://stackoverflow.com/questions/63402588/how-can-nodemon-be-made-to-work-with-wsl-2) – NotTheDr01ds Jul 29 '21 at 17:21
-
I'm not using nodemon. I am using node only for compiling sass and minifying js. I have modified the question to include this detail as well. Thanks for asking. – shivamag00 Jul 30 '21 at 18:40
-
I understand that you aren't using `nodemon`, but if you read the answer on that post, the underlying problem (and answer) is the same for both -- Lack of `inotify` support on the Windows file systems under WSL. – NotTheDr01ds Jul 30 '21 at 18:51
-
I agree the underlying problem is same but the question is different. The link contains multiple answers which does not seem to be necessary to answer this question like using legacy nodemon. – shivamag00 Jul 30 '21 at 21:10
1 Answers
3
This is because of the way WSL 2 works. File changes made by Windows apps on Windows filesystem don't trigger notifications for Linux apps. This issue is currently open on GitHub at this link.
To make it work, store your project files in the home directory on Linux filesystem (cd ~
will take you to home directory). Run gulp watch again and you should be good to go !!!

shivamag00
- 661
- 8
- 13