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, ground nutmeg, and ground ginger.
03 - In a large bowl, beat eggs, granulated sugar, vegetable oil, applesauce, and vanilla extract until mixture is well combined and slightly thickened.
04 - Gradually fold the dry mixture into the wet ingredients until just blended. Do not overmix the batter.
05 - Fold in finely grated carrots and, if desired, chopped walnuts or pecans until evenly distributed.
06 - Divide batter evenly among cupcake liners, filling each about three-quarters full.
07 - Bake on the center rack 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 softened butter and cream cheese together until smooth. Gradually add powdered sugar, then vanilla extract and a pinch of salt, and continue mixing until frosting is light and fluffy.
10 - After cupcakes are fully cooled, frost each generously with cream cheese frosting before serving.