01 - Set oven to 350°F. Grease and flour two 9-inch round cake pans.
02 - In a large mixing bowl, whisk together flour, granulated sugar, baking powder, baking soda, salt, ground cinnamon, nutmeg, and ginger until well blended.
03 - Add vegetable oil and eggs to the bowl. Mix until the batter is fully combined and smooth.
04 - Stir grated carrots, crushed pineapple, vanilla extract, and chopped walnuts (if using) into the batter until evenly distributed.
05 - Evenly pour and level the batter into the prepared cake pans.
06 - Place pans in the oven and bake for 30 to 35 minutes, or until a toothpick inserted in the center comes out clean.
07 - Allow cakes to cool in the pans for 10 minutes, then turn onto a wire rack to cool completely.
08 - Once cakes are fully cooled, frost with cream cheese frosting as desired.