01 - Preheat oven to 350°F. Line a 12-cup muffin pan with paper liners.
02 - In a medium bowl, whisk together all-purpose flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger until well blended.
03 - In a large bowl, beat eggs, granulated sugar, vegetable oil, applesauce, and vanilla extract until the mixture is fully combined and slightly thickened.
04 - Gradually fold the dry ingredients into the wet mixture, mixing just until no flour streaks remain. Avoid overmixing.
05 - Gently fold in grated carrots and, if desired, the chopped walnuts or pecans until evenly distributed.
06 - Divide batter evenly between the cupcake liners, filling each about three-quarters full for even rising.
07 - Bake for 20 to 22 minutes, or until a toothpick inserted into the center emerges clean.
08 - Allow cupcakes to cool in the pan for 5 minutes before transferring to a wire rack to cool fully.
09 - In a large bowl, beat softened butter and cream cheese together until smooth. Gradually blend in powdered sugar, then add vanilla extract and a pinch of salt. Beat until light and fluffy.
10 - Once cupcakes have cooled, generously frost each one with cream cheese frosting and serve.