SAN JUAN, Puerto Rico — The eye of Hurricane Maria was nearing the Turks and Caicos early Friday as Puerto Rico sought to recover from the storm’s devastation.

Two days after Maria ravaged Puerto Rico, flooding towns, crushing homes and killing at least two people, millions on the island faced the dispiriting prospect of weeks and perhaps months without electricity. The storm knocked out the entire grid across the U.S. territory of 3.4 million, leaving many without power.

The loss of power left residents hunting for gas canisters for cooking, collecting rainwater or steeling themselves mentally for the hardships to come in the tropical heat. Some contemplated leaving the island.

“You cannot live here without power,” said Hector Llanos, a 78-year-old retired New York police officer who planned to leave Saturday for the U.S. mainland to live there temporarily.

Like many Puerto Ricans, Llanos does not have a generator or gas stove. “The only thing I have is a flashlight,” he said, shaking his head. “This is never going to return to normal.”

Maria’s death toll across the Caribbean, meanwhile, climbed to at least 27. There were at least 15 deaths on Dominica and six on Puerto Rico. Other islands reporting deaths were Haiti, three; Guadeloupe, two; and Dominican Republic, one.

As of Friday morning, Maria was passing northeast of the Turks and Caicos with winds of 125 mph. A hurricane warning remained in effect for those islands as well as the southeastern Bahamas. The storm is expected to veer into the open Atlantic and pose no threat to the U.S. mainland.

In Puerto Rico, the grid was in sorry shape long before Maria — and Hurricane Irma two weeks ago — struck.

The territory’s $73 billion debt crisis has left agencies like the state power company broke. It abandoned most basic maintenance in recent years, leaving the island subject to regular blackouts.

“We knew this was going to happen given the vulnerable infrastructure,” Gov. Ricardo Rossello said.

The Federal Emergency Management Agency said it would open an air bridge from the mainland on Friday, with three to four military planes flying to the island every day carrying water, food, generators and temporary shelters.

“There’s a humanitarian emergency here in Puerto Rico,” Rossello said. “This is an event without precedent.”

He said his administration was trying to open ports soon to receive shipments of food, water, generators, cots and other supplies.

The government has hired 56 small contractors to clear trees and put up new power lines and poles and will be sending tanker trucks to supply neighborhoods as they run out of water. The entire island has been declared a federal disaster zone.

Mike Hyland, senior vice president of engineering services for the American Public Power Association, a utility industry group that is sending repair crews into the Caribbean, refused to speculate on how long it would take to restore power in Puerto Rico.

“Let’s see what the facts tell us by the end of the weekend,” he said. But he acknowledged: “This is going to be a tall lift.”

Maribel Montilla already had two large barrels filled with water but worried about how long it would last for her, her daughter, her son-in-law and six grandchildren.

“You know what I think? We’re going to be without power for six months now,” she said.

Cellphone and internet service collapsed in much of Puerto Rico. The only radio station that remained on the air during the hurricane — WAPA 680 AM — was relaying messages to help connect friends and families.

Other concerns were more prosaic. Across the street, someone yelled at a neighbor, “Listen, do you have Netflix?!”

Jaime Rullan, a sports commentator, has a gas stove at home but tried not to think about the lack of air conditioning on an island where the heat index has surpassed 100 degrees in recent days.

“We’re used to the lights going out because of storms here in Puerto Rico, but this time, we’re worried,” he said. “We should prepare ourselves mentally to be at least a month without power.”

Deysi Rodriguez, a 46-year-old caretaker for elderly people, does not have a gas stove. And unlike others who have been lining up at the few fast-food restaurants that have reopened, Rodriguez is a diabetic and has to be more careful about what she eats.

Rodriguez said she might temporarily move to New Jersey if the situation gets worse.

Pedro Cartagena, a 57-year-old dock supervisor, said he planned to shower, eat and sleep at his company’s office. He plans to buy food at the few restaurants that are open and operating on generators.

“That’s going to drain my bank account,” he said, “but if I want to eat, that’s my only option.”

In an upscale neighborhood in San Juan, 69-year-old retiree Annie Mattei’s condominium has a generator. But she said maintenance will shut it off between 11 a.m. and 5 p.m. to save fuel.

“This has been devastating,” she said as her eyes welled with tears.

In the Dominican Republic, Maria knocked down trees and power lines. But Joel Santos, president of the country’s hotel association, said the hurricane did not damage the tourism infrastructure, even though it passed close to Punta Cana, the major resort area on the eastern tip of the island.

In hard-hit Dominica, where Maria laid waste to hundreds of homes and was blamed for at least 15 deaths, Prime Minister Roosevelt Skerrit wept as he spoke to a reporter on the nearby island of Antigua.

“It is a miracle there were not hundreds of deaths,” he said. He added: “Dominica is going to need all the help the world has to offer.”