Two influential lawmakers in New York plan to introduce a new bill this week tailored to win Mr. Cuomo’s backing, and activists are organizing a last-minute push. And in New Jersey, the proposal’s sponsors have discussed changing the current bill, including removing an expungement provision that would have cleared convictions for people who were caught in possession of up to five pounds of marijuana.

But the same challenges that doomed the previous effort remain.

A well-coordinated coalition of opponents, including law enforcement officials and parent-teacher associations, has warned skittish lawmakers of public safety consequences. The pro-legalization movement has also been divided by a debate over how to guarantee economic reinvestment in minority communities.

In New York, four counties have already declared their intention to opt out of any legalization law, including both populous counties on Long Island. More than 40 towns in New Jersey have also declared they would opt out, or have already voted to ban marijuana businesses from opening there.

There are no models for what New York and New Jersey are trying to do. Of the 10 states that have legalized recreational marijuana, only Vermont did so through legislation rather than by ballot initiative. But Vermont does not allow commercial sales, effectively confining the drug to be grown in homes.

States that have already legalized marijuana through ballot referendums have run into problems: Emergency room visits rose in Colorado, the black market continued to thrive in California and every state saw vast racial disparities in marijuana business ownership.

Lawmakers in New York and New Jersey had promised to learn from those examples. They set ambitious goals: addressing racial inequity in the industry; clearing past criminal records for minor drug offenses; and keeping taxes low enough to wipe out the black market, but high enough to generate meaningful revenue.