The invention discloses a method for preparing a compound 2-(imidazo [1,2-a] pyridine-3-yl) acetonitrile, which is a new method for preparing a key intermediate of minodronic acid, comprising the steps of: with a compound 3- imidazo [1, 2-a] pyridine carboxaldehyde with the formula (II) and a compound tosylmethyl isocyanide with the formula (III) as raw materials, carrying out chemical reaction in an organic solvent containing glycol dimethyl ether and an alkaline medium of potassium tert-butoxide or sodium tert-butoxide; separating and purifying to obtain the compound 2-(imidazo [1, 2-a] pyridine-3-base) acetonitrile, wherein the process of the chemical reaction is disclosed in the specification of the invention. In the invention, by means of the method for preparing the compound with the formula (I), the reaction procedure is shortened, the technical process of the whole reaction is simplified, the use of a highly toxic material sodium cyanide is avoided, the operability of the reaction is strong, the yield is high, and the obtained product has high purity, lower cost, and is easy for the application in the industrialized production.