The nervy win meant Barca capitalised on Real's defeat at Espanyol on Saturday which now sees the Catalunians four points behind Real and three behind Atletico Madrid ahead of the Madrid derby this coming weekend.
Relegation-threatened Alaves proved a tough cookie to crack, and ultimately only a Robert Lewandowski goal just past the hour mark could split the sides.
Such a tight outcome was particularly surprising considering the Catalans had got off to such a dynamic start. The jaw-dropping sight of Lamine Yamal zig-zagging his way through a mass of Alaves players before serving up Raphinha for a chance that sadly went astray suggested it would be another rip-roaring display, but it turned out to a relatively uneventful 45 minutes, with the visitors getting a worryingly large share of the threat, but Hansi Flick's offside trap doing its job.
Both sides, and all onlookers too, were particularly shell-shocked by a horrendous clash of heads between Gavi and Tomas Conechny. The latter came off worse, while the Barça player was adamant that he was able to continue, but Flick was already decided that Fermin Lopez should take his place.
As the minutes ticked by, things started to get worrying. Barça were in control, but not massively so. What little the Alaves defence couldn't deal with, their goalkeeper Jesus Owono could, and the all-important deadlock-breaking goal was not forthcoming.
However, Barça pressed and pressed until Alaves were finally broken in the 61st minute. Pedri picked out Lamine, and the 17-year-old's volley was met with another from short range by Lewandowski as Flick's side saw out the remainder of the match to seal the win.