check to see if there is a vacume leak at the intake manifold. squirt carbrator cleaner at the area where the intake meets the head and see if the engine idle changes. if it does replace the intake manifold.
check to see if there is oil leaking out from inside the distributor. if there is it is likely getting on the optical wheel inside the distributor. replace distributor.
check to see if there is oil on the plug wires. where they go down into the hole on top of the valve cover, remove plug wires and see if there is oil on them. if so, replace the valve cover gasket, 2 peices. clean out the holes and clean the plug wires.
if none of these things are a problem, then have the base idle adjusted. you cannot adjust the base idle without fixing these other problems first.
also have you altornator and battery checked..
thats about all I got at the moment. those are the most common things to cause an altima to stall.
adjust the base idle then.
here is how.
warm up car. disconnect grey 3 prong connector from throttle position sensor.
if car dies, the base idle is too low and you need to raise it. if it does not die, then raise it to 750 rpm.
the screw to raise it is located behind the intake manifold. straight down. on the pass side of the engine. it is a screw that is hard to see but it is in between cyl#1 and #2 runner for the intake. look down between the runners with a flashlight to see it.
turn it counter clockwise, to raise the base idle. once adjusted plug the throttle sensor back in and drive to retest.
is there any codes stored?
is the check engine light one?
is the alternator good?
is the battery good?
idle is computer controlled.
you have to disable the computer controll to set the base idle.
you do that by adjusting idle the way i described.
it is common for people to miss this minor adjustment.
try disconnecting the throttle sensor and tell me what it idles at then.
do you have any more info then?
does it hessitate? or completely shut off?
does it backfire?
does this happen at idle? or on acceleration?
if all I stated above is ok.
then try swapping the air flow meter with a known good one. that is a guess. but all I got.
the air flow meter is not cheap though.
I have heard some people having sucess by cleaning them with carburator cleaner or brake cleaner. but I also have heard people ruin the air flow meter that way.
the air flow meter does not always code when it is failing.
Ive given you all the common reasons. that one is just a last resort.
the absolute most comon problem is the base idle, when all those other things check out.
goodluck. sory I can't be more help.