Is it an EU country? In every European country I've had direct experience with (DK, DE, IT, PT, FR, BE), you can get a residence permit with the right to work by applying as an accompanying spouse, or under a family reunification scheme. Of course, in some countries this can take time, but certainly not 8 years.
Additionally, under the 'Directive on the status of non-EU nationals who are long-term residents'[1], you have the right to obtain permanent residence in any EU country you have lived in legally for 5 years. Unless you've been living in the EU illegally (e.g. on a tourist visa for 8 years) or not reporting your income/paying social contributions, you should be eligible for that. As with all/most EU directives, the specific implementation can vary between countries, but the immigration authorities are obliged to have some kind of process for implementation.
[1] https://home-affairs.ec.europa.eu/policies/migration-and-asy...