That answer could be written much better, but it does give the solution to the problem. And it is introducing the solution. That is, it's not a "thanks" answer or success report relating to another answer (in fact, there is no other answer). This is the OP reporting the solution, which was the right thing to do, done in the right way.
In a different situation where the combination of the problem and its solution are not valuable, the solution is to close the question. Only if it's clearly not an answer at all--in this context, typically either not even an attempt to provide information about what solved the problem, or a thanks answer relating to another existing post--should an OP's answer be flagged.
A question should only be closed if it's clearly not valuable; not just because it seems like it will likely not be valuable. The necessary standard is met from time to time. For example, if the OP's solution is "I gave up" or "I realized all the error messages I showed you were from a totally different machine and had nothing to do with the problem; I pressed enter and it installed."
For questions like those examples, with self-answers that indicate the problem was never really there in the first place, where there's nothing that would help someone else in a similar situation, the question can be flagged as too localized (or close-voted with that close reason, for users with 3000 reputation or more).