Pathfinder cuts off while driving

I have a '97 Nissan Pathfinder and about 10 days ago it started cutting off while driving or accelerating, and takes about 10 seconds to turn over when I start it. While driving it will sputter, the RPMs drop, and then it cuts off. It won’t cut off when idling, just while driving. I had a diagnostic check run, and the fuel pump and filter replaced, but it still cuts off sometimes. Several check engine lights come on when it dies, but not when I start it or am driving. Just wondering if anyone has any ideas about what else it could be.