An electric ratchet wrench comprising: a body including a first end and a second end spaced from the first end along a first axis, with the first end of the body including an inner periphery having a toothed portion; a driving device mounted to the first end of the body, with the driving device including a driving member, a pawl device pivotably mounted to the driving member, and a first ring gear rotatably mounted around the driving member, with the driving member including an end adapted for directly or indirectly driving a fastener, with the pawl device configured to selectively mesh with the toothed portion of the body, with the first ring gear rotatable relative to the driving member in a clockwise direction or a counterclockwise direction, with the first ring gear including an inner toothed portion on an inner periphery thereof and an end toothed portion on an end face thereof, with the inner toothed portion of the first ring gear configured to selectively mesh with the pawl device; an elastic device (30; 30a) mounted between the first end of the body and the first ring gear; a power device received in the second end of the body, with the power device including a motor; and a transmission device including a transmission shaft rotatably mounted to the body, with the transmission shaft including a first end connected to the motor, with the transmission shaft further including a second end configured to switch between a meshing state meshed with the end toothed portion of the first ring gear and a disengagement state disengaging from the end toothed portion of the first ring gear, wherein if a resistance smaller than a torque outputted by the motor is encountered while the driving member is driving a fastener, the transmission shaft is in the meshing state and drives the first ring gear to rotate, the driving member is rotated to continuously drive the fastener, and wherein if a large resistance larger than the torque outputted by the motor is encountered at a position while the driving member is driving the fastener, the transmission shaft is in the disengagement state and causes a tooth slippage phenomenon in which the transmission shaft repeatedly engages with and disengages from the end toothed portion of the first ring gear, such that the first ring gear cannot be rotated and such that the transmission shaft compresses the elastic device (30; 30a), the body can be manually rotated to overcome the large resistance and to forcibly drive the fastener through the position via the driving member, and the transmission shaft reengages with the first ring gear under action of the elastic device after the fastener passes through the position. a body including a first end and a second end spaced from the first end along a first axis, with the first end of the body including an inner periphery having a toothed portion; a driving device mounted to the first end of the body, with the driving device including a driving member, a pawl device pivotably mounted to the driving member, and a first ring gear rotatably mounted around the driving member, with the driving member including an end adapted for directly or indirectly driving a fastener, with the pawl device configured to selectively mesh with the toothed portion of the body, with the first ring gear rotatable relative to the driving member in a clockwise direction or a counterclockwise direction, with the first ring gear including an inner toothed portion on an inner periphery thereof and an end toothed portion on an end face thereof, with the inner toothed portion of the first ring gear configured to selectively mesh with the pawl device; an elastic device (30; 30a) mounted between the first end of the body and the first ring gear; a power device received in the second end of the body, with the power device including a motor; and a transmission device including a transmission shaft rotatably mounted to the body, with the transmission shaft including a first end connected to the motor, with the transmission shaft further including a second end configured to switch between a meshing state meshed with the end toothed portion of the first ring gear and a disengagement state disengaging from the end toothed portion of the first ring gear, wherein if a resistance smaller than a torque outputted by the motor is encountered while the driving member is driving a fastener, the transmission shaft is in the meshing state and drives the first ring gear to rotate, the driving member is rotated to continuously drive the fastener, and wherein if a large resistance larger than the torque outputted by the motor is encountered at a position while the driving member is driving the fastener, the transmission shaft is in the disengagement state and causes a tooth slippage phenomenon in which the transmission shaft repeatedly engages with and disengages from the end toothed portion of the first ring gear, such that the first ring gear cannot be rotated and such that the transmission shaft compresses the elastic device (30; 30a), the body can be manually rotated to overcome the large resistance and to forcibly drive the fastener through the position via the driving member, and the transmission shaft reengages with the first ring gear under action of the elastic device after the fastener passes through the position.