-
Preheat your oven to 350°F. Grease and flour two 9-inch round cake pans and line the bottoms with parchment paper.
-
In a large bowl, whisk together the flour, baking soda, cinnamon, nutmeg, ginger, and salt.
-
In another bowl, whisk the sugar, oil, eggs, and vanilla until smooth. Pour the wet ingredients into the dry and stir until just combined.
-
Fold in the finely grated carrots, crushed pineapple (drained well), pecans, and coconut if using. The batter will be thick.
-
Divide the batter evenly between the two pans. Bake for 30-35 minutes until a toothpick comes out clean and the tops spring back when gently pressed.
-
Let cool in the pans for 10 minutes, then turn out onto wire racks to cool completely. Don't frost a warm cake — the frosting will slide right off.
-
For the frosting, beat the cream cheese and butter until smooth. Add the powdered sugar and vanilla and beat on low, then increase to medium until fluffy. Frost the top of one layer, stack the second on top, then frost the top and sides.
-
Press toasted pecans around the sides or sprinkle on top. Refrigerate for at least 30 minutes before slicing — the frosting sets up and the cake slices much cleaner cold.