Preheat your oven to 350°F and line muffin tins with cupcake liners. In a medium bowl, whisk together the flour, espresso powder, baking soda, baking powder, pumpkin pie spice, and salt until well combined; set this mixture aside. In the bowl of a stand mixer fitted with the paddle attachment, combine the pumpkin puree, granulated sugar, brown sugar, and vegetable oil, mixing until smooth. Add the eggs one at a time, beating well after each addition to fully incorporate. Reduce the mixer speed to low and gradually add the dry flour mixture in two parts, mixing just until everything is combined—avoid overmixing. Spoon the batter into the cupcake liners, filling each about three-quarters full. Bake for 20 to 22 minutes, or until the cupcakes turn golden and a toothpick inserted in the center comes out clean. Allow the cupcakes to cool in the pan for 10 minutes before transferring them to a wire rack to cool completely.
For the espresso buttercream, use the paddle attachment to cream the softened butter on medium speed until smooth and creamy. Lower the mixer speed and slowly add the confectioners’ sugar, one cup at a time, mixing well after each addition until fully incorporated. Stir in the espresso powder and vanilla extract. Begin adding 2 tablespoons of milk and then increase the mixer speed to medium-high, beating the frosting until it’s light, fluffy, and spreadable—about 5 to 8 minutes. If the frosting feels too thick or dry, add additional milk, one teaspoon at a time, until you achieve your preferred consistency. Once the cupcakes are completely cooled, pipe or spread the espresso buttercream evenly over the tops and serve.