For a guy whose party is supposed to be united behind him, Ralph Northam has faced moments of surprising disharmony from fellow Democrats in his campaign for Virginia governor.

The lieutenant governor has been shouted down by protesters at public events and drawn sniping on party blogs, all over a single issue: energy companies building two natural gas pipelines in rural parts of the state. Northam won’t oppose the projects. Some Democrats despise them.

While a few worry that the open dissent will wreck his chances this November, numbers suggest that there aren’t enough disgruntled pipeline opponents to make a difference in the election. After all, the pipelines are being built in areas with far more natural beauty than voters.

But what the pipeline opponents lack in quantity, they make up for with passion.

“This community is widespread and powerful, and they would work their hearts out for him,” Kay Leigh Ferguson, a Charlottesville resident who is an active pipeline opponent, said about the Democratic nominee for governor. “I think Northam ignores that at his peril.”

The issue involves two projects inspired by the boom in fracked natural gas. The $5 billion Atlantic Coast Pipeline, proposed by Dominion Energy and several partners, would run some 550 miles from West Virginia through central and southern Virginia and into North Carolina, with a spur flung out to Hampton Roads.

The 300-mile Mountain Valley Pipeline would also start in West Virginia, but would enter Virginia in the southwest — near Blacksburg — and connect with an existing pipeline in Pittsylvania County. It’s being built by a partnership led by EQT Midstream.

Northam casts himself as an environmentalist — raised on the Eastern Shore, opposed to offshore drilling, an advocate for alternative energy. But he has been unusually hazy on the pipelines, saying only that they need tough environmental oversight and that their fate is in the hands of federal regulators. Like Gov. Terry McAuliffe, a fellow Democrat who has more openly supported the pipelines as job ­creators, Northam has collected thousands of dollars in campaign donations from Dominion.

His Republican opponent, Ed Gillespie, fully supports the pipelines. He also has received contributions from Dominion. Even though pipeline opposition unites Republicans and Democrats in affected parts of the state, Gillespie has seen nothing like the blowback aimed at Northam.

And Gillespie’s campaign has delighted in skewering Northam over the issue. Republicans have unity problems of their own — Gillespie nearly lost the gubernatorial nomination to Corey A. Stewart, who ran on protection of Confederate symbols and devotion to President Trump, despite the president’s low poll standings in Virginia. Stewart has grudgingly said he’ll vote for Gillespie but has refused to endorse him.

So state Republicans have been quick to highlight the Democratic divide over the pipelines. Gillespie spokesman David Abrams retweets every news article or blog post about Northam’s controversial position, with lead-ins such as “Brutal stuff here” and “Another brutal . . . piece.”

In the odd position of attacking Northam for seeming to agree with Gillespie on an issue, the Republican campaign is trying to paint the Democrat as moving to the right of his base. “Lieutenant Governor Northam winked and nodded to liberal Democrats in his primary, and now he’s winking and nodding to the broader electorate,” Abrams emailed when asked for a comment.

The pipeline issue did, in fact, dog Northam throughout the primary. His upstart challenger for the nomination, former congressman Tom Perriello, made opposition to the pipelines a centerpiece of his campaign and hoped the passion of pipeline opponents would help counter the support Northam got from the party establishment.

The strategy delivered a huge boost for Perriello in rural parts of the state. Even some Republican-leaning voters tilted to him over the pipeline issue because of concerns about eminent domain and property rights. In 17 counties and three cities of southwestern Virginia, Perriello won by an overall 30 percent margin.

But Northam won the more populous parts of the state, where the pipelines have no direct impact and little visibility, and beat Perriello by 12 points. The city of Alexandria alone made up for Perriello’s margin in all of the southwestern part of the state.

Perriello’s loss devastated some pipeline opponents. But they vowed to keep up the fight. One protester interrupted Northam’s opening statement at his debate with Gillespie this month; a band of college students even briefly took over the stage at Northam’s primary election victory party in June.

Josh Stanfield of Activate Virginia, a grass-roots group recruiting Democratic candidates for House of Delegates races, has found himself drawn into the governor’s contest by the pipelines. He posted an essay on the Blue Virginia blog last week, slamming Northam and encouraging people to continue speaking out.

Supporting the pipelines “ends up completely in line with the Trump regime,” Stanfield wrote. He accused Northam of breaking with Democratic values because of a crass calculation that defying the protesters will not “translate into the loss of a significant bloc of votes.”

The essay sparked an immediate debate, with some party faithful arguing that airing dirty laundry and tearing down Northam could have the same result that attacks on Hillary Clinton had last fall: snatching defeat from the jaws of victory.

“Martyrs always take a perverse joy in their martyrdom. But true progressives understand that getting 95% of what you want in a candidate is better than 0%,” Del. Mark H. Levine (D-Alexandria) posted as part of a lengthy back-and-forth.

Stanfield dismisses that argument. He’s voting for Northam either way, he said. But the candidate needs to be pushed. “This is about making the basic Democratic case that we should oppose all new fossil-fuel infrastructure pipelines,” he said.

Northam’s campaign spokesman rejected the notion that the candidate’s position on the pipelines is simply a political calculation. “The political ramifications have mattered very little in what the lieutenant governor wanted to say on the issue,” spokesman David Turner said. “Science should say whether they can be built safely and environmentally sound.”

The vocal opposition is not a concern, Turner said. “We’re a big-tent party, and we welcome a host of ideas across the spectrum.”

He pointed out that the League of Conservation Voters endorsed Northam despite disagreeing with him on the pipelines. The Sierra Club did the same.

And the hard truth is that Northam could have more to lose by opposing the pipelines than by sticking with them and enduring the taunts.

Dominion is a powerful political force in the state — and not just through donations. It has tens of thousands of employees, retirees and shareholders in Virginia, as well as a vast customer base. Ahead of the primary, ­Dominion sent out mailers reminding people to check the candidates’ pipeline positions before voting.

In addition, the Laborers’ International Union of North America, which represents the workers who build such pipelines, has given heavily to Democrats over the years.

Pipeline opponents know what they’re up against but believe right is on their side. They have walked 150 miles of the Atlantic Coast Pipeline route, staged outdoor concerts, posted mini-documentaries on Facebook, organized art events and spoken out at local government meetings all over the region.

Some are taking a hard look at Cliff Hyra, a Libertarian running for governor who opposes the pipelines. If the race between Northam and Gillespie is tight, Hyra could play the spoiler — giving the protesters more power than they seem to have now.

“I spent a lifetime primarily voting for the lesser evil,” said Mara Robbins, an environmentalist in Floyd County who has worked against the Mountain Valley Pipeline. “Those of us who are taking this stand are getting slammed right and left by party loyalists, by people saying this is what happened with Hillary and Trump and Bernie [Sanders] supporters who wouldn’t vote for Hillary.

“The most common thing we hear is that this is just going to get Gillespie elected. Well, if that’s what Northam wants, that’s what’s going to happen,” she said. “I can’t think that way anymore.”