I have an older Macbook Air, and I was not paying attention to the battery (which dies rather quickly now) when the computer shut down suddenly. I went and retrieved my power cord and plugged it in. I waited a few minutes to give it a chance to charge a bit and then powered it back on. Normally, it just boots right back up with no issues, but this time, it took extra long and then popped up a light blue screen with an open window showing the boot log and an error message saying “MacOS installation couldn’t be completed.”
Luckily, I had my phone handy and could search for solutions there. I found quick a few people experiencing the same issue. Apparently, my Mac had started upgrading to the latest version of MacOS, but hadn’t finished, and then when my computer crashed, it messed up the completion of the installation.
The fix for this is time-consuming, but in the end, relatively painless. I had to get to the Recovery Options by rebooting again and pressing Command + R during boot up. This spun for a while and then brought me to a window with several options. I clicked on the option to reinstall MacOS, confirmed, and my computer began to download the installation file, which took about 20 minutes (on a high-bandwidth fiber connection).
I was then able to start installation, following the instructions through agreeing to the terms, choosing a location to install, etc. Installation took a long time, well over an hour. Once installation was complete, though, I was able to boot up and everything was back to normal. I had not lost any of my data, including even which windows were open when my computer originally crashed hours before. Yay!