It looks like I have fixed it by downloading and using Quartus 19.1. Quartus 18.1 still doesn't work consistently, so I am going to use 19.1 from now on.
"To work around this problem, adjust the FLEXLM_TIMEOUT environment variable in the client machine, the available range is from 0 to 2,147,483,647 microseconds. Default value is 100 microseconds.
For example to set the variable to 1 second, set the variable as follows:
so I think we should add an environment variable of:
Yes, This will increase the amount of time for Quartus to wait for a response from the license manager. You can try higher value as well.