Preheat the Oven:
Preheat your oven to 350°F (175°C). Grease and flour your cake pans, or line them with parchment paper for easy removal.
Prepare the Dry Ingredients:
In a large bowl, sift together flour, sugar, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
Mix the Wet Ingredients:
In another bowl, whisk together the vegetable oil and eggs until well combined.
Stir in the grated carrots, crushed pineapple, nuts, coconut (if using), and vanilla extract.
Combine the Mixtures:
Gradually add the dry ingredients to the wet ingredients, mixing just until combined. Be careful not to overmix; a few lumps are okay.
Bake the Cake:
Divide the batter evenly between the prepared cake pans or pour into the 9x13 inch pan.
Bake for 25-30 minutes (for round pans) or 35-40 minutes (for a 9x13 inch pan), or until a toothpick inserted into the center comes out clean.
Allow the cakes to cool in the pans for 10 minutes, then transfer to a wire rack to cool completely.
Prepare the Cream Cheese Frosting:
In a large bowl, beat together the cream cheese and butter until smooth and creamy.
Gradually add the powdered sugar, beating until fully incorporated and smooth.
Stir in the vanilla extract and a pinch of salt.
Frost the Cake:
Once the cakes are completely cool, spread a layer of cream cheese frosting on top of one cake layer (if using two layers), then place the second layer on top.
Frost the top and sides of the cake with the remaining cream cheese frosting.
Decorate and Serve:
For a finishing touch, you can decorate with additional chopped nuts or a sprinkle of cinnamon on top of the frosting.
Slice and enjoy this delicious old-fashioned carrot cake!