01 - Preheat oven to 350°F. Line a 12-cup muffin pan with cupcake liners.
02 - In a medium bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger until evenly combined.
03 - In a large bowl, beat eggs, granulated sugar, vegetable oil, applesauce, and vanilla extract together until mixture is smooth and slightly thickened.
04 - Gradually fold the dry ingredients into the wet mixture, mixing only until just combined to maintain tenderness.
05 - Gently fold in the grated carrots and, if using, chopped walnuts or pecans.
06 - Divide batter evenly among the cupcake liners, filling each about three-quarters full.
07 - Bake for 20 to 22 minutes, or until a toothpick inserted into the center emerges clean.
08 - Let cupcakes rest in the pan for 5 minutes, then transfer to a wire rack and cool completely before frosting.
09 - Beat softened butter and cream cheese together until smooth. Gradually add powdered sugar, then vanilla and salt, beating until light and fluffy.
10 - Once cupcakes are completely cool, generously frost each one with the prepared cream cheese frosting.