The Astros needed 107 wins over the span of six months to secure what was supposed to be the all-important, super-critical home-field advantage for October.

And the Yankees stole it away from them Saturday night in a little more than three hours with a 7-0 shutout that transformed Minute Maid Park into the Houston Public Library for Game 1 of the ALCS.

Masahiro Tanaka extended his October brilliance by allowing one hit in six innings — dropping his career playoff ERA to 1.32 — and the Yankees made a mockery of the percolating dead-ball discussion as Gleyber Torres, Giancarlo Stanton and Gio Urshela homered.

Torres, who had five RBIs, began nudging the muzzled fans toward the exits with his two-run single in the seventh inning. And once Urshela launched one into the rightfield seats, that emptied half the demoralized ballpark.

The Yankees felt they had to play a near-perfect game to beat an Astros team that was close to unbeatable at Minute Maid Park this season, carrying a 63-21 record (including playoffs) into the ALCS opener. But past performance is not a guarantee of future success, and the Yankees are not the same team that got swept in Houston in April, nor do they resemble the 2017 club that lost all four ALCS games at Minute Maid to get bounced in seven.

“I never felt like there was a monkey on our back,” said Aaron Judge, who was a 52-homer rookie on that ’17 team. “I’ve never felt like we couldn’t do something, especially with the team that we’ve got. This is a special club, so anybody we play, anywhere we go, we’re ready.”

Second baseman Gleyber Torres turns a double play to end...

Second baseman Gleyber Torres turns a double play to end the seventh inning. Torres had five RBIs in the Yankees' 7-0 victory in Game 1 of the ALCS on Saturday, Oct. 12, 2019, in Houston.   Credit: Newsday/J. Conrad Williams Jr.

Two of the most notable additions, Torres and Stanton, have no bitter memories from two years ago because one was a minor-leaguer at home rehabbing from Tommy John surgery and the other was doing what Marlins usually do in October — watching the playoffs on TV.

None of the Astros looked as comfortable Saturday night playing beneath the noisy roof as Torres, 22, who rapidly is turning this month into Gley-tober. After stepping up in the Yankees’ dismissal of the Twins, he never broke stride in the ALCS opener, going 3-for-5, including a solo homer into the Crawford Boxes high above the leftfield wall.

As for that home-field edge for the Astros, how about this nifty factoid, courtesy of Statcast: Based on the metrics — launch angle, exit velo, etc. — Torres’ 343-foot shot was a home run in only one of the 30 MLB ballparks. Fortunately for the Yankees, it’s the place they happened to be playing Game 1.

Of course, real estate has very little to do with Torres’ emergence as one of the sport’s elite players, a reputation that he’s polishing nightly during these playoffs.No wonder Aaron Boone had the wisdom to bump Torres up to No. 3 in the order for the ALCS, the lone significant change after using the same lineup for all three wins of the Division Series.

“I just go to the plate believing what I can do,” said Torres, who joined Mickey Mantle as the only two under-23 players in Yankees history with homers in multiple postseason games. “Each opportunity I get, I just believe in myself.”

As for Stanton, we were ready to blame Rob Manfred’s curiously deadened playoff baseballs when a few flyouts strangely lost altitude. But that thought was retracted in the sixth inning when Stanton launched a 406-foot rocket into the Astros’ bullpen.

While Tanaka made sure the Houstonians had almost zero to cheer about after the big flag and national anthem, the Yankees’ defense added to the fans’ growing frustration. Two gems in particular stood out.

The first came after Alex Bregman led off the fifth with a walk. When Yordan Alvarez smoked a line drive that Judge reached up to snag in right-center, Bregman stumbled while trying to return to first, and Judge made him pay by doubling him off with a bullet throw that DJ LeMahieu scooped with a backhand.

“I just kind of chucked it in there, I just kind of winged it, and he made a good play,” Judge said. “Just being able to shut down that inning was huge.”

In the seventh, after Didi Gregorius bafflingly pulled up to let Jose Altuve’s soft grounder leak up the middle — putting Astros at the corners with one out — Bregman smacked the next pitch to start a double play. Torres had to hurry with a hard, one-hop throw and was saved by another LeMahieu scoop. The Yankees needed a challenge to get the out they deserved, and kept the Astros off the scoreboard when they got it.

That’s how it was all night in Game 1. The Yankees were always a step ahead of the Astros, frustrating them in every way, giving them a taste of their own Minute Maid medicine.

“Game 1 is the most important, that’s what I’ve said for a while now,” Judge said. “Especially to come in here and beat them at their own house, that’s huge. We went out there and did our job.”