Preheat oven to 350°F (175°C). Line a muffin tin with cupcake liners.
In a large bowl, mix together flour, sugar, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, whisk together oil, eggs, and vanilla extract. Add to the dry ingredients and mix until just combined.
Fold in the grated carrots.
Divide the batter evenly among the cupcake liners. Bake for 20-25 minutes or until a toothpick inserted into the center comes out clean. Let cool completely.
For the frosting, beat together cream cheese and butter until smooth. Gradually add powdered sugar and vanilla extract, beating until creamy.
Frost the cooled cupcakes and serve.