CLEVELAND — The Knicks were without Carmelo Anthony while the Cavaliers had LeBron James and were at full strength for the first time this season. But instead of waving a white flag the Knicks almost pulled off a near-Christmas miracle.

They fought the deeper, more talented Cavaliers until the bitter end. But they couldn’t make plays down the stretch and James and the Cavaliers did. Cleveland ended the game on an 11-2 run and held off a gritty Knicks team, 91-84, Wednesday night at Quicken Loans Arena.

“That’s a tough one,” Derek Fisher said. “We had our chances. We made some mistakes and not just down the stretch but in the first half and that caught up with us.”

Playing without Anthony, who sat out because of a sprained right ankle, the Knicks had trouble scoring with the game on the line. They led 82-80 with 4:07 remaining, but faded after that and scored just two points the rest of the way.

Their next five possessions resulted in three misses and two turnovers. The Knicks (14-16) didn’t score again until Arron Afflalo hit inside with 36.8 seconds left to bring the Knicks within 88-84. They were 6-for-24 (25 percent) with three turnovers and scored 12 points in the fourth.

“No excuses,” Fisher said. “We still had our opportunities. We have to accept that and really be a no-excuse team. But the things that happened out there, whether Carmelo’s playing or not, you can’t do those things against the best teams in the league and expect to win.”

Unlike Monday’s game when Fisher left Kristaps Porzingis on the bench in crunchtime for defensive purposes, the rookie was on the floor in the fourth. But the Knicks didn’t look for Porzingis enough.

Porzingis finished with a Knicks-high 23 points and 13 rebounds. But Porzingis didn’t score in the fourth and didn’t take a shot until he heaved a desperation three just before the final buzzer. Porzingis was 8-for-18, including 4-for-5 from three.

“I’ve got to be more aggressive at the end maybe,” Porzingis said.

“I don’t think Kris had a lot of opportunities down the stretch,” Fisher said. “Some of that is us. Some of that is how they defended us.”

Afflalo scored 16 and Jose Calderon had 10. Lance Thomas, who started in place of Anthony, had eight points.

James scored 24, including six of Cleveland’s last 11. He also had nine rebounds and five assists. Kevin Love added 23 and 13 rebounds, and Tristan Thompson 10 and 14 boards.

Anthony went through the morning shoot around but when he tested his sprained right ankle at the hotel in the afternoon, he had trouble pushing off and moving laterally. He didn’t want to risk further injury, and believes he should play in the Knicks’ next game, Saturday in Atlanta.

“Usually I would try to play through these [minor] injuries,” Anthony said. “But I didn’t want to take a chance of it lingering.”

The Cavaliers led by 11 in the first quarter and looked poised to run away from the undermanned Knicks. But the Knicks hung around and tied the game 68-68 with 3:37 left in the third. They took their first lead, 74-72, on a Lou Amundson put-back 47 seconds into the fourth.

After Cleveland went up 77-74 on a James layup with 8:01 left, Afflalo scored six consecutive points for the Knicks and gave them a 80-79 lead with a driving layup with 5:28 left. It stayed that way until a Love free throw with 4:31 left tied it again.

Langston Galloway nailed a jump shot to put the Knicks back on top 82-80, but Thompson scored inside to tie it and the Knicks wilted from there.

After a timeout, Thomas threw the ball away, leading to a James basket in transition. Following a Thomas miss, James was fouled going to the basket and hit both free throws to make it 86-82. Afflalo then turned it over and James threw down a big dunk to give Cleveland a six-point lead with 51.9 seconds left.

“We were fighting hard the whole game,” Porzingis said. “We have heart. We fell a little short at the end.”