With Harvey’s destruction still fresh on people’s minds, Florida hustled into action. Gov. Rick Scott activated the state National Guard to help with hurricane preparations, and he suspended highway tolls. On Monday, the governor declared a state of emergency and spoke with Mr. Trump, who offered “the full resources of the federal government,” Mr. Scott wrote on Twitter.

Most of the latest projections have Irma making landfall in Florida by Sunday, although it is unclear where exactly that might happen.

The Florida Keys, an especially vulnerable chain of islands, moved quickly to prepare for crushing winds and possible flooding. On Wednesday, schools will be closed and mandatory evacuations will begin, county officials said. The Keys’ three hospitals started evacuating patients on Tuesday.

Miami-Dade, the state’s largest county, announced that schools would close on Thursday and officials began putting emergency plans into place.

But Puerto Rico and the northern Leeward Islands are expected to be hit before that. It has been nearly a century since Puerto Rico was hit by a Category 5 storm, Mr. Norcross of the Weather Channel said.

Puerto Rican officials have warned that the island’s fragile electrical grid could be shut down for days, weeks or even months in some areas. In his news conference, Mr. Rosselló and emergency officials warned that with such powerful winds expected to thrash the island, infrastructure, houses and the phone system would inevitably be damaged.

For Puerto Rico, the hurricane could not have come at a worse time. The island is in the throes of an economic crisis and does not have money for a long rebuilding process.

“This is not going to be easy,” said Héctor Pesquera, the superintendent of public security in Puerto Rico.

Abner Gómez Cortés, the head of Puerto Rico’s emergency agency, warned that coastal zones were particular vulnerable — not so much because of rain, as with Harvey — but because of storm surges of up to 20 feet.

On Tuesday, the lines for fast-dwindling gas, food, water and hardware seemed interminable and anxiety mounted. One hardware store in San Juan had been nearly picked clean by afternoon.

“This has been like this for the last three days,” said Juan Carlos Ramirez, the store manager. “We’ve sold all of the most necessary items — flashlight, batteries, plywood.”

People standing in line said one of their biggest worries was the expected loss of electricity for long periods. “The infrastructure can’t cope with a hurricane,” Ashley Albelo, a shopper, said.

Outside a Sears, Maria Ruiz could not help but remember Hurricanes Hugo and George, which badly damaged Puerto Rico. “Destruction,” she said. “That is what we can expect based on past experiences, and it’s already a Category 5.’’

Similar fears were apparent on nearby islands. In Antigua, southeast of Puerto Rico, many businesses were closed. Supermarkets were overrun and gas stations were packed.