This was a horror movie, I’m guessing late eighties or early nineties. It had a Stephen King vibe, but I haven’t found it in his catalog. All I remember is that the protagonists were in a cabin in the woods, which had a string of electric light bulbs powered by a gas generator. There was something in the woods that was stalking them, but it was repelled by light. As long as the lights stayed on, they had a fighting chance, but if the lights went out, it would get them. I don’t remember what “it” was, aliens, demons, criminals, insects…simply can’t remember. They were nearly out of gasoline, and the generator was sputtering, causing the lights to flicker.
Oh, it was that one then. 🙂
Episode titled “Darkness Falls” of the series “The X Files” (1994)
https://www.imdb.com/title/tt0751097/
Quote from an IMDb user review:
“(trapped in a log cabin, they die when the generator runs out of gas and lights goes off)”
Are you certain it was a movie and not an episode series? I know there was an X-Files episode that was very similar to what you’re describing.