01 - Preheat oven to 350°F. Line a 12-cup muffin tin with paper liners.
02 - In a medium bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger until well combined.
03 - In a large bowl, beat granulated sugar, brown sugar, oil, eggs, and vanilla extract until smooth and well incorporated.
04 - Gently fold the dry ingredients into the wet mixture until just combined. Be careful not to overmix.
05 - Stir in grated carrots along with nuts and raisins if using.
06 - Divide batter evenly among cupcake liners, filling each about 3/4 full. Bake for 20–22 minutes or until a toothpick inserted comes out clean.
07 - Let cupcakes cool in the pan for 5 minutes, then transfer to a wire rack to cool completely before frosting.
08 - Beat cream cheese and butter together until creamy. Add powdered sugar, vanilla, and salt. Beat until smooth and fluffy.
09 - Once cupcakes are completely cool, frost generously with the cream cheese frosting.