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 - Gently fold dry ingredients into the wet mixture until just combined, avoiding overmixing the batter.
05 - Fold in the finely grated carrots and, if using, the chopped nuts.
06 - Divide batter evenly among the liners, filling each about three-quarters full.
07 - Bake for 20 to 22 minutes, or until a toothpick inserted into the center of a cupcake 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 until smooth and creamy. Gradually blend in powdered sugar, then add vanilla extract and a pinch of salt. Beat until the frosting is light and fluffy.
10 - Once cupcakes are fully cooled, frost each generously with cream cheese frosting.