Category: Tips

Issue with watch script on »Bash on Ubuntu on Windows« and saving in PhpStorm

Recently I had a problem with a running watch script on Bash on Ubuntu on Windows (the Windows Subsystem for Linux (WSL)) to compile SASS and saving of files in PhpStorm. PhpStorm showed an error message »Cannot save. The file is left unchanged« and created a temporary file with the changes.

I found the solution for that in the support forum from JetBrains. To solve the issue, just uncheck the box Use »Safe write« in the PhpStorms settings under FileSettingsAppearance & BehaviorSystem Settings.

Reinstall »Bash on Ubuntu on Windows«

If you want to reinstall Bash on Ubuntu on Windows, you can follow these steps. In the command prompt, run the following command to uninstall the currently installed version:

lxrun /uninstall /full

/full also removes the home folder. After that, you should be able to run a reinstall with the following command (theoretically):

lxrun /install /y

This does not work for me… I always get an error (I think it was this one: Error: 0x80070091). Luckily, I am not the first one with that problem – the reason for that is the not-deleted lxss folder in the local AppData directory. Before running the installation command, use the following one for removing the folder (I got the solution from a GitHub issue):

rmdir /S "\\?\C:\Users\Username\AppData\Local\lxss"

Of course, you need to replace Username with your user name. Afterward, you can run lxrun /install /y to start the installation (hopefully) without any errors.