If that is the case, then the President should declare it as such, suspending the Constitution and order troops to repel the invasion.
Defending the nation from invasion is right there IN the Constitution in black and white, in language a simpleton can understand.
U.S. Constitution, Article 4 Section 4:
"The United States shall guarantee to every State in this Union a Republican Form of Government,
1. The act of invading; the act of encroaching upon the rights or possessions of another; encroachment; trespass.
U.S. Constitution, Article I, Section 8: To borrow money on the credit of the United States; To regulate commerce with foreign nations, and among the several states, and with the Indian tribes; To establish a uniform rule of naturalization, and uniform laws on the subject of bankruptcies throughout the United States; To coin money, regulate the value thereof, and of foreign coin, and fix the standard of weights and measures; To provide for the punishment of counterfeiting the securities and current coin of the United States; To establish post offices and post roads; To promote the progress of science and useful arts, by securing for limited times to authors and inventors the exclusive right to their respective writings and discoveries; To constitute tribunals inferior to the Supreme Court; To define and punish piracies and felonies committed on the high seas, and offenses against the law of nations; To declare war, grant letters of marque and reprisal, and make rules concerning captures on land and water; ... .The Congress shall have power to lay and collect taxes, duties, imposts and excises, to pay the debts and provide for the common defense and general welfare of the United States; but all duties, imposts and excises shall be uniform throughout the United States;
Never. This isn't some two-bit banana republic. The Contitution is flexible enough to bend a good ways before breaking, and if it didn't need to be suspended in 1861-65, you'd have to go a long way to imagine a scenario where that would have to be necessary.