Preheat Oven: Set your oven to 350°F (175°C). Grease and flour a 9×13 inch cake pan or two 9-inch round cake pans.
Dry Ingredients: In a medium bowl, sift together flour, baking powder, baking soda, salt, cinnamon, nutmeg, cloves, and ginger.
Wet Ingredients: In a large bowl, beat together sugar, oil, and eggs until smooth and well combined. Gradually add the dry ingredients to the wet ingredients, mixing until just combined.
Add Carrots and Nuts: Fold in the grated carrots, chopped walnuts, and raisins if using.
Bake: Pour the batter into the prepared pan(s) and smooth the top. Bake for 45-50 minutes, or until a toothpick inserted into the center comes out clean.
Make Frosting: Beat together cream cheese, butter, and vanilla until smooth. Gradually add powdered sugar and beat until creamy and spreadable.
Cool and Frost: Allow the cake to cool completely in the pan on a wire rack. Once cool, frost with the cream cheese frosting and sprinkle with extra walnuts if desired.
Serve: Cut into squares or slices and enjoy the rich, spiced flavor of this classic carrot cake!