Zinc oxide nanorods were synthesized directly on a silicon microcantilever and converted into a nanoporous ZIF-8 film via a solvothermal reaction. The simultaneous measurements of the resonance frequency and deflection of the cantilever revealed that the adsorption of alcohol vapors induced a structural change in the ZIF-8 framework.