01 - Preheat 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 the mixture is smooth and slightly thickened.
04 - Gradually fold the dry ingredients into the wet mixture until just combined. Do not overmix.
05 - Gently fold in the grated carrots and, if desired, the chopped walnuts or pecans.
06 - Divide the 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 comes out clean.
08 - Allow cupcakes to cool in the pan for 5 minutes, then transfer to a wire rack to cool completely.
09 - Beat the softened butter and cream cheese together until smooth. Gradually add the powdered sugar, then mix in vanilla extract and a pinch of salt. Beat until fluffy.
10 - Once the cupcakes are completely cool, frost generously with the prepared cream cheese frosting.