Battery manufacturing emissions are dwarfed by lifetime emissions of a gasoline powered car, according to the EPA. They do about double the emissions for manufacturing, but that's not all that much.
https://www.epa.gov/greenvehicles/electric-vehicle-myths
This doesn't take away the main point of your comment of course, you're right that keeping a vehicle longer is the most impactful decision.