Preheat your oven to 350°F (175°C). Grease and flour a 9x13 inch baking pan or two 9-inch round cake pans.
In a large bowl, whisk together the flour, baking soda, cinnamon, nutmeg, cloves, and salt.
In a separate bowl, combine the sugar, oil, eggs, and vanilla extract. Beat until well combined.
Gradually add the dry ingredients to the wet ingredients, mixing until just combined. Do not overmix.
Fold in the grated carrots, walnuts (or pecans), and raisins (if using).
Pour the batter into the prepared pan(s) and spread evenly.
Bake for 30-35 minutes, or until a wooden skewer inserted into the center comes out clean.
Let the cake cool in the pan for 10 minutes before transferring it to a wire rack to cool completely.
In a large bowl, beat the softened cream cheese and butter until smooth and creamy.
Gradually add the powdered sugar, beating until smooth. Stir in the vanilla extract.
Add milk or cream, one tablespoon at a time, until you reach your desired frosting consistency.
Once the cake is completely cool, frost the top (and sides, if desired) with the cream cheese frosting.
Refrigerate the frosted cake for 30 minutes to allow the frosting to set (optional).
Slice and serve your delicious Carrot Cake with Cream Cheese Frosting.