Move the oven rack to the middle position and preheat the oven to 350 degrees F.
Spray a 13x9-inch pan with nonstick cooking spray; set aside.
MAKE THE BATTER:
Mix flour, baking powder, baking soda, cinnamon, nutmeg, cloves, and salt in a medium bowl. Set these dry ingredients aside.
Using the large holes of a box grater, shred carrots (you should end up with about 3 cups).
In the bowl of a stand mixer fitted with a paddle attachment, beat the granulated sugar, brown sugar, and eggs on medium-high until combined, about 45 seconds.
Reduce the speed to low, and slowly pour in the oil.
Then, increase the speed to high and mix until the mixture is light in color and well blended, about 60-90 seconds.
Turn the mixer off and fold in the carrots, dry ingredients, and coconut by hand until the batter is evenly mixed and no streaks of flour remain.
Pour the batter into the prepared pan and spread it into an even layer.
BAKE AND COOL CAKE:
Bake until a toothpick inserted into the center comes out clean, about 35-40 minutes.
Place the cake on a wire rack and cool to room temperature for about 2 hours.
MAKE CARROT CAKE FROSTING:
Once the cake is cool, make the frosting. Add the cream cheese, butter, sour cream, and vanilla to the stand mixer bowl fitted with the whisk attachment.
Mix on high until combined, about 60 seconds, scraping down the sides of the bowl as needed.
Add the powdered sugar and mix on high until nice and fluffy, about 1 minute.
FINISH THE CAKE:
Spread the frosting evenly over the cake using an offset spatula.
Sprinkle the cake with chopped nuts or shredded coconut (both optional).