Nancy Pelosi was meeting with her caucus for the first time since late June

US House Speaker Nancy Pelosi on Wednesday urged unity among fellow Democrats in the face of battles over the direction of the party and warned members to ditch Twitter and keep their disagreements private.

"You got a complaint? You come and talk to me about it. But do not tweet about our members and expect us to think that that is just OK," Pelosi said during a closed meeting of House Democrats, according to a source who was in the room.

It was not clear if Pelosi, the top elected U.S. Democrat, was aiming her remarks at a specific lawmaker's tweet or issuing a general warning about using social media, the favourite means of communication for Republican President Donald Trump.

Pelosi's approach on matters ranging from protecting young immigrants in detention to whether to impeach Trump has faced resistance from some liberals, including progressives who swept into office in last year's elections when Democrats won control of the House of Representatives.

She reminded her caucus on Wednesday of the need for compromise given Republican control of the Senate and White House, making clear she had her eye on posting gains in the November 2020 elections.

Pelosi was meeting with her caucus for the first time since late June, when the liberal wing of her party failed to win stronger standards for the treatment of immigrants being detained at the southern border with Mexico.

Pelosi now faces another challenge as the House prepares to debate and vote this week on legislation reauthorising U.S. defence programs.

Some liberals are balking at the $733 billion price tag of the bill and are seeking a wide range of amendments, while Trump and some of his fellow Republicans in Congress are seeking even more money for the military. The White House on Tuesday threatened a veto of the House bill.

Failure to pass a measure in the House would be a major setback for Pelosi. But her lieutenants were predicting victory.

"We had a robust discussion in the caucus this morning" on the bill, said Representative Hakeem Jeffries, a member of the House Democratic leadership team.

A more blunt Pelosi warned her rank and file: "This is a team. On a team you play as a team." But she acknowledged that lawmakers of various political stripes sometimes had to go their own way on votes.

"I hope there will be some level of respect and sensitivity" for lawmakers who "have to fight for their re-election," she said in an obvious reference to freshmen Democrats representing districts that have either supported Trump or elected Republican House members in the past.

"So, if some of you have some unease about the voting records of other people as they represent their districts and you represent your districts, understand the value of the (House) majority," Pelosi said.

'THE SQUAD'

All 435 House seats will be up for grabs next year, when Trump also faces re-election.

"We must win this next (House) election and it is no foregone conclusion that we will," Pelosi admonished her fellow Democrats.

Among the most outspoken House liberals are freshmen Representatives Alexandria Ocasio-Cortez, Ilhan Omar, Rashida Tlaib and Ayanna Pressley, sometimes known as "the squad."

In an interview last week with the New York Times, Pelosi said: "All these people have their public whatever and their Twitter world." She added: "But they didn't have any following."

After Wednesday's closed-door meeting, Ocasio-Cortez told reporters she was willing to work in a collaborative way on the defence bill that she is seeking to amend.

Referring to last month's battle over the border aid bill, Ocasio-Cortez said it was "sloppy" because it was advanced in a "rushed process."

This week's battle, however, is a "more deliberate, more transparent process," she said.