This problem can increase the risk of a crash if the driver inadvertently puts the car into gear.
The 39,000 recalled vehicles were 2012 models made from June 9, 2011 through Jan. 13, 2012 and sold in the U.S. and Canada. The problem affects cars with automatic and continuously variable transmissions.
No injuries or crashes have been reported, but federal safety regulations require that a driver's foot be on the brake.
Nissan said it will replace the shifter knob for free.
The Associated Press contributed to this report.