We report on the first-principles calculations of bandgap modulation in armchair MoS2 nanoribbon (AMoS2NR) by transverse and perpendicular electric fields respectively. In the monolayer AMoS2NR case, it is shown that the bandgap can be significantly reduced and be closed by transverse field, whereas the bandgap modulation is absent under perpendicular field. The critical strength of transverse field for gap closure decreases as ribbon width increases. In the multilayer AMoS2NR case, in contrast, it is shown that the bandgap can be effectively reduced by both transverse and perpendicular fields. Nevertheless, it seems that the two fields exhibit different modulation effects on the gap. The critical strength of perpendicular field for gap closure decreases with increasing number of layers, while the critical strength of transverse field is almost independent of it.