Preheat and Prepare:
Preheat your oven to 350°F (175°C).
Grease and flour two 9-inch round cake pans or line them with parchment paper.
Mix Dry Ingredients:
In a large bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, nutmeg, cloves, and ginger.
Mix Wet Ingredients:
In a separate large bowl, beat together the granulated sugar, brown sugar, and vegetable oil until smooth.
Add the eggs one at a time, beating well after each addition.
Stir in the vanilla extract.
Combine:
Gradually add the dry ingredients into the wet ingredients, mixing until just combined.
Gently fold in the grated carrots, crushed pineapple, and chopped nuts (if using).
Bake:
Divide the batter evenly between the prepared pans.
Bake for 30–35 minutes, or until a toothpick inserted in the center comes out clean.
Let the cakes cool in the pans for 10 minutes, then turn them out onto a wire rack to cool completely.
Make the Frosting:
In a large bowl, beat the cream cheese and butter together until smooth and creamy.
Gradually add the powdered sugar, beating until light and fluffy.
Add the vanilla extract and a splash of milk if needed to adjust consistency.
Assemble the Cake:
Place one cake layer on a serving plate.
Spread a generous layer of cream cheese frosting over the top.
Place the second cake layer on top and frost the top and sides of the cake.
Garnish with extra chopped nuts if desired.