"macOS needs to repair your library to run applications"
My wife's computer (a recent Mac Mini, still running Mojave) has gotten into an impossible state. When she (or anyone else) logs in, a dialog box appears with the above text, and "Enter your password to allow this". When you enter the user's password, and click "repair", it just puts up the dialog box again. Forever. And you can't do anything else. I have looked at other instances of this problem (mostly on High Sierra systems), but the suggested remedies don't work. In particular, the Apple-suggested remedy of opening Get Info on the home directory, unlocking Sharing & Permissions and then clicking "Apply to enclosed items", letting that run, and then restarting does no good (I've tried it three times with the same non-result). Apple then suggests that if this fails, reinstall macOS. Problem is, she's allowed so much stuff to accumulate on the machine that there's no disk space left, so "reinstall macOS" can't go through.
Any suggestions would be MUCH appreciated.