01 - Preheat oven to 350°F. Line a 12-cup muffin pan with paper cupcake liners.
02 - In a medium bowl, whisk together flour, baking powder, baking soda, salt, ground cinnamon, nutmeg, and ginger until thoroughly blended.
03 - In a large mixing bowl, beat eggs, granulated sugar, vegetable oil, applesauce, and vanilla extract until blended and slightly thickened.
04 - Gradually fold the dry mixture into the wet mixture, mixing just until no flour streaks remain. 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 prepared 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 - Let cupcakes cool in the pan for 5 minutes, then transfer to a wire rack to cool completely.
09 - In a bowl, beat softened butter and cream cheese until smooth. Gradually add powdered sugar, then vanilla and a pinch of salt. Beat until fluffy and fully incorporated.
10 - Once cupcakes are completely cool, apply cream cheese frosting generously on top of each cupcake.