His own White House lawyer, Don McGahn, warned him that such behavior could be impeachable. From the NYTimes:
The lawyer, Donald F. McGahn II, rebuffed the president, saying that he had no authority to order a prosecution. Mr. McGahn said that while he could request an investigation, that too could prompt accusations of abuse of power. To underscore his point, Mr. McGahn had White House lawyers write a memo for Mr. Trump warning that if he asked law enforcement to investigate his rivals, he could face a range of consequences, including possible impeachment.