Because of the genius idea at the time to give everything their own M* designation there is a .30cal AN/M2, .50cal AN/M2 and 20mm AN/M2. Just like you can say "give me an M3" and nobody knows of you want a half-track, light tank, medium tank, combat knife or submachine gun (to name a few).
There's the AN/M2 aircraft cannon (developed from the Hispano HS.404) but it was also a designation for the .50 M2 used for planes and the .30 M1919 used for planes, although generally it was only given the full "AN/" in a naval context from what I've seen. The army and USAAC/F would just call it the M2 or M1919.
Fun factoid of the day: the "AN" stood for Army/Navy, as the designation was applied to the things that both used, such as the M2 Browning and various bombs.
Anyway none of this matters because the Stinger was an M1919, not an M2 Browning or an AN/M2 cannon.