There may be a way around it:
https://en.wikipedia.org/wiki/National_Popular_Vote_Interstate_Compact
National Popular Vote Interstate Compact
The National Popular Vote Interstate Compact (NPVIC) is an agreement among a group of U.S. states and the District of Columbia to award all their electoral votes to whichever presidential candidate wins the overall popular vote in the 50 states and the District of Columbia. The compact is designed to ensure that the candidate who receives the most votes nationwide is elected president, and it would come into effect only when it would guarantee that outcome.[2][3] As of March 2019[update], it has been adopted by thirteen states and the District of Columbia. Together, they have 184 electoral votes, which is 34.2% of the Electoral College and 68.1% of the 270 votes needed to give the compact legal force.
Mechanism[edit]
Proposed in the form of an interstate compact, the agreement would go into effect among the participating states in the compact only after they collectively represent an absolute majority of votes (currently at least 270) in the Electoral College. In the next presidential election after adoption by the requisite number of states, the participating states would award all of their electoral votes to the candidate with the largest national popular vote total in the 50 states and the District of Columbia. As a result, that candidate would win the presidency by securing a majority of votes in the Electoral College. Until the compact's conditions are met, all states award electoral votes in their current manner.
The compact would modify the way participating states implement Article II, Section 1, Clause 2 of the U.S. Constitution, which requires each state legislature to define a method to appoint its electors to vote in the Electoral College. The Constitution does not mandate any particular legislative scheme for selecting electors, and instead vests state legislatures with the exclusive power to choose how to allocate their states' electors (although systems that violate the 14th Amendment, which mandates equal protection of law and prohibits racial discrimination, would be prohibited).[3][4] States have chosen various methods of allocation over the years, with regular changes in the nation's early decades. Today, all but two states (Maine and Nebraska) award all their electoral votes ("winner-take-all" style) to the candidate (single winner) with the most votes (first-past-the-post system) statewide (at-large). Maine and Nebraska currently use the congressional district method, awarding one electoral vote winner-take-all in each congressional district, and their remaining two electoral votes winner-take-all in their state-wide vote.
[...]