The invention provides a pyrrolo [2, 3-d] pyrimidine derivative targeting EGFR mutation as well as a preparation method and application thereof, and belongs to the field of chemical medicines. The derivative is a compound shown as a formula I, or a salt thereof, or a stereoisomer thereof. The compound disclosed by the invention is low in toxicity to normal cells, has an obvious inhibition effect on a lung cancer cell line, particularly has good selectivity on EGFR mutant cells HCC827, and has an obvious inhibition effect; meanwhile, the compound provided by the invention can effectively inhibit phosphorylation of EGFR. In addition, the compound provided by the invention has good inhibitory activity and selectivity on mutant EGFR. The compound disclosed by the invention can be used for treating lung cancer, particularly non-small cell lung cancer, has a relatively strong inhibition effect on EGFR mutant lung cancer, and is relatively low in toxicity; the compound can also be used for preparing tyrosine kinase inhibitors, especially EGFR phosphorylation inhibitors, and has good application prospects.