stalling issues on 2003 Nissan Altima

My altima has been working fine up until today ... I tried starting my car but its stalling. Put it in drive gave it gas but it didn't move .. so I put in park then back to drive. It pulled off but no matter far the peddle was down it wouldn't go pass 30mph . The battery/sevice engine light were both on. Then after about 5 miles it picked up speed and was back to normal. Could anyone please help me out with this problem? Thank You!

Asked by for the 2003 Nissan Altima
1 answer 3 comments
take it down and have the mass air flow sensor checked , i had sentra that was doing the same thing , and when i replaced it , it never stalled again .
Thank u! And where is that located? I'm tryna rule out the fuel pump and cataylic converter.

the mass air flow sensor is mounted right on the air intake tube between the air filter box and the trottle body , well atleast on a sentra , its been along time since ive been under the hood of an altima
K! Ty!!!!