You need a smog to register a vehicle for the first time(and every couple years depending on your county).a check engine light fails the visual part of a smog.1973 and older are smog exempt.
It is supposed to be the sellers responsibility but car guys usually just sign a paper saying they will take care of it themselves if it is a project vehicle.
The pukes in government want to get rid of everything but teslas by making it harder to keep older cars on the road.