Prep the basics: Heat oven to 350°F (175°C). Line a 12-cup muffin tin with paper liners.
Whisk the dry mix: In a bowl, whisk flour, baking powder, baking soda, salt, cinnamon, and nutmeg until evenly combined.
Mix the wet ingredients: In a separate large bowl, whisk eggs, both sugars, oil, applesauce, and vanilla until smooth and slightly thick.
Combine gently: Add dry ingredients to wet and fold with a spatula until just combined. Do not overmix.
Batter will be thick.
Fold in the carrots: Stir in grated carrots and any optional nuts or raisins until evenly distributed.
Fill the liners: Divide batter among liners, filling about 3/4 full for nice domes.
Bake: Bake 18–22 minutes, until tops spring back and a toothpick comes out with a few moist crumbs. Rotate the pan once if your oven has hot spots.
Cool completely: Let cupcakes cool in the pan 5 minutes, then transfer to a rack to cool fully before frosting.
Make the frosting: Beat cream cheese and butter until creamy. Add powdered sugar, vanilla, and a pinch of salt.
Beat until fluffy, adding more sugar to reach a smooth, pipeable texture.
Frost and finish: Swirl frosting onto cooled cupcakes. Top with a sprinkle of chopped nuts or a dusting of cinnamon if you like.