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.
03 - In a large bowl, beat eggs, granulated sugar, vegetable oil, applesauce, and vanilla extract until well combined and slightly thickened.
04 - Gradually fold the dry mixture into the wet mixture until just combined, taking care not to overmix the batter.
05 - Fold grated carrots and the chopped walnuts or pecans, if using, into the batter.
06 - Divide batter evenly among prepared 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 - In a mixing bowl, beat softened butter and cream cheese until smooth. Gradually add powdered sugar, followed by vanilla extract and a pinch of salt, mixing until light and fluffy.
10 - Once cupcakes are completely cool, frost generously with cream cheese frosting before serving.