Preheat the oven to 175°C (350°F). Grease and flour a small round or loaf cake pan.
In a bowl, whisk together flour, sugar, baking powder, baking soda, cinnamon, nutmeg, and salt.
In a separate bowl, whisk together the egg, vegetable oil, and milk. Gradually add the wet ingredients to the dry ingredients and mix until smooth.
Fold in the grated carrots. Pour the batter into the prepared pan and smooth the top.
Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. Let the cake cool completely.
For the frosting, beat the cream cheese, powdered sugar, and vanilla extract until smooth and fluffy.
Spread the frosting evenly over the cooled cake. Slice and serve.