The governors of New York and New Jersey have issued states of emergency, and thousands of flights have been canceled.