Preheat the oven to 350°F. Line a 12-cup muffin pan with paper cupcake liners.
In a large mixing bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, ginger, and nutmeg.
In a medium bowl, whisk together the oil, both sugars, eggs, and vanilla until well combined. Pour the wet mixture into the dry mixture and stir together with a spatula until almost combined.
Add the carrots and walnuts and stir until well distributed and there aren’t any flour streaks remaining.
Divide the batter among the cupcake liners. (They should be about three-quarters full.)
Bake for 17 to 20 minutes, or until the centers feel springy to the touch or a wooden toothpick inserted into the center comes out clean.
Cool for a few minutes in the pan, then remove and finish cooling on a wire rack.
In a large bowl with a hand mixer or stand mixer fitted with the paddle attachment, beat the cream cheese and the butter together on medium speed until smooth, about 1 minute.
With the mixer on low speed, gradually add in the powdered sugar. Once combined, scrape down the bowl, add the vanilla, and beat on medium speed until light and fluffy.
Top the cupcakes with frosting by spreading it on with a spatula, or transferring it to a piping bag with a decorative tip and piping over the top.
Store the cupcakes covered in the refrigerator for up to 5 days.
