A new pyrenylbenzylidene–malononitrile (P2) was successfully synthesized via the Suzuki coupling reaction and Knoevenagel condensation using nano Cu as a catalyst. Nanofiber sheet mixed with compound 2 detects and responds to hydrazine vapor with a detection limit of 0.005% (w/v).