2000 dodge 1500 engine starts intermittently on 2000 Dodge Ram 1500

Always cranks fine but some times won't turn over. Cranks strong and then slightly fires when key is being turned off. I can smell gas vapors at exhaust pipe. Check engine light comes on occasionally but the last time it started flashing and had loss of power.

Asked by for the 2000 Dodge Ram 1500
scan codes and post so we can adv