Could be the MAF ( Mass Air Flow) sensor, if not try resetting the ECU, located behind the plastic to the right of the gas pedal. Remove the plastic and you should see the ECU, there is a flat-head screw located on it, insert the key into the ignition, and turn to on position, "DO NOT START THE ENGINE". Turn the screw all the way to the right, or clockwise hold for 2 seconds, then turn counter clockwise all the way, hold for 2 seconds, ECU will clear all trouble codes, turn screw clockwise back to original position, remember to mark the position the srew is in before making any adjustments.
If a 1997 Nissan Altima cuts off at a stop light, there is a problem with the fuel getting to the engine. When you are accelerating, there is pressure and a higher flow of fuel, which is why it won't cut off then. The problem could be a leak in the fuel line, the fuel pump itself, or a fuel filter. It will need to be serviced.
On the firewall on the driver side under the hood.
Where is the fuel pump located on a 1996 Nissan Altima
The 1997 Nissan Altima with the 2.4L 4-cylinder has a gasoline capacity of 15.9 gallons. The recommended fuel grade for this vehicle is regular unleaded (87 octane).
The simple and really only answer I can give you is to find the leak and repair it.
where is the fuel pump of nissan altima 2006 located
Where is the fuel pressure regulator 97 altima
The 2010 Nissan Altima runs on regular unleaded.
The 2003 Nissan Altima runs on regular unleaded.
The 2014 Nissan Altima runs on regular unleaded.
The 2004 Nissan Altima runs on regular unleaded.
The 2011 Nissan Altima runs on regular unleaded.