All the Yankees needed was one win in two games for a ticket to the World Series.

They had momentum on their side, Luis Severino and CC Sabathia at the ready on full rest to start and an offense that had just exploded during three straight wins at Yankee Stadium.

And then the Astros sent the Yankees’ improbable season crashing down to earth with two thorough beatings on back-to-back nights in October 2017, ending a powerhouse ALCS battle that went seven games. The Yankees were left ruing their chances as the Astros went on to beat the Dodgers in the World Series for their first title in franchise history.

Two years later, the Yankees are still searching for championship No. 28, and standing in the way are the Astros again for an ALCS rematch that begins Saturday night in Houston.

Minute Maid Park served as a house of horrors for the Yankees in the 2017 playoffs. They lost the first two games there, won all three at Yankee Stadium and then went back to Houston and dropped Game 6 and 7. They had two golden opportunities to win and move on to the Fall Classic, but came up empty both times.

Hanging over the Yankees’ head was their failure to produce any kind of offense at Minute Maid Park. In four games there, the Yankees mustered three runs, batting 20-for-126 (.159) with six extra-base hits and 48 strikeouts. In the three games at Yankee Stadium, they came alive for 19 runs, batting 25-for-93 (.269) with 12 extra-base hits and 22 strikeouts.

Of course, the Yankees did have to face Justin Verlander twice at Minute Maid Park. The then-new Astros ace tossed a complete game with 13 strikeouts in a Game 2 win, which the Yankees lost when Carlos Correa (9-for-27 in the series) hit a walk-off double against Aroldis Chapman in the bottom of the ninth. Verlander came back for Game 6 and delivered again, tossing seven shutout innings and striking out eight on the way to a 7-1 win over Severino and Co.

Charlie Morton then got the ball for Game 7 and went the first five innings, allowing just two hits and a walk. The Yankees’ best chance to score came in the fifth, when Greg Bird was thrown out at the plate on a ground ball to third by Todd Frazier. In the bottom of the frame, Tommy Kahnle let the deficit slip from 1-0 to 4-0, and the Astros were on their way. Lance McCullers Jr. relieved Morton and shut down the Yankees over the final four innings to win it.

The crushing series loss did not come without some big moments from Aaron Judge and Gary Sanchez. Judge hit three home runs, including a three-run shot in Game 3, and turned in a handful of defensive gems in right field. Sanchez hit just 5-for-26 in the series, but came through with the game-winning, two-run double in the eighth inning of Game 4 — after Judge’s RBI double had tied it — that capped off a six-run comeback from a 4-0 deficit.

With Masahiro Tanaka tossing seven shutout innings in a Game 5 win to take a 3-2 series lead, the Yankees left the Stadium after making it roar like the new one never had before.

The Yankees weren’t expected to even be in the ALCS when the 2017 season began. They had finished in fourth place in the AL East the year before and were expected to go through some growing pains with a roster in transition, with FanGraphs projecting them to go 81-81. Judge was a rookie. Severino was an unproven starter in an unsteady rotation. Sanchez had to prove his smashing 2016 debut was not a fluke.

Meanwhile, the Opening Day lineup included veterans Jacoby Ellsbury, Matt Holliday, Starlin Castro and Chase Headley.

By October, the Yankees had arrived ahead of schedule with the “thumbs-down” era in full force. After beating the Twins in the AL wild-card game, they took the 102-win Indians’ best shot in the ALDS, falling behind 0-2 before storming back to win the next three and advance.

They were on the verge of accomplishing the same feat against the 101-win Astros in the ALCS, but this one took four wins. The Yankees came within 27 outs before their offense went into hibernation early.