Preheat your oven to 350°F (175°C).
Grease and flour two 9-inch round cake pans.
In a large bowl, whisk together the flour, sugar, baking powder, baking soda, cinnamon, nutmeg, and salt.
Create a well in the center of your dry ingredients.
Add eggs, oil, crushed pineapple (with juice), grated carrots, coconut flakes, and vanilla extract.
Stir until just combined—don’t overmix!
Divide the batter evenly between prepared pans.
Bake in preheated oven for 25-30 minutes until golden brown.
Check doneness by inserting a toothpick; it should come out clean.
While cakes cool, mix softened cream cheese with butter until creamy.
Gradually add powdered sugar and vanilla until smooth.
After cooling completely, place one cake layer on a serving plate.
Spread frosting generously between layers and on top.
Add additional coconut flakes for decoration if desired.