Preheat your oven to 350°F (175°C). Grease and flour a 9x13 inch baking pan.
In a large bowl, mix together the flour, granulated sugar, brown sugar, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, beat the eggs and add the vegetable oil and vanilla extract. Mix well.
Add the wet ingredients to the dry ingredients and stir until just combined.
Fold in the grated carrots and chopped walnuts.
Pour the batter into the prepared baking pan and spread it evenly.
Bake for 30-35 minutes, or until a toothpick inserted into the center comes out clean.
Allow the cake to cool completely in the pan on a wire rack.
For the frosting, beat together the softened butter and cocoa powder until well combined.
Gradually add the powdered sugar and milk, beating until the frosting is smooth and creamy.
Stir in the vanilla extract.
Spread the chocolate frosting evenly over the cooled carrot cake.
Cut into squares and serve.