01 - Preheat the oven to 350°F. Line a 12-cup muffin pan with cupcake liners.
02 - In a medium bowl, whisk together all-purpose flour, baking powder, baking soda, salt, ground cinnamon, nutmeg, and ginger.
03 - In a large bowl, beat the eggs, granulated sugar, vegetable oil, applesauce, and vanilla extract until thoroughly combined and slightly thickened.
04 - Gradually fold the dry ingredients into the wet mixture, mixing until just combined. Avoid overmixing the batter.
05 - Fold in the grated carrots and, if desired, the chopped walnuts or pecans.
06 - Divide the batter evenly among the prepared liners, filling each about three-fourths full. Bake for 20 to 22 minutes, or until a toothpick inserted into the center emerges clean.
07 - Allow cupcakes to cool in the pan for 5 minutes. Transfer to a wire rack to cool completely before frosting.
08 - Beat softened butter and cream cheese together until smooth. Gradually add powdered sugar, then blend in vanilla extract and a pinch of salt, continuing to beat until light and fluffy.
09 - Once cupcakes are completely cool, generously spread cream cheese frosting over each cupcake.