01 - Preheat the oven to 350°F. Grease and flour two 9-inch round cake pans, or line with parchment paper.
02 - In a large bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, and nutmeg until well combined.
03 - In another bowl, beat together the granulated sugar, brown sugar, oil, eggs, and vanilla until well combined and slightly pale.
04 - Gradually add the dry ingredients to the wet, mixing just until incorporated. Do not overmix.
05 - Fold in the grated carrots, chopped walnuts, pineapple, and raisins if using, until evenly distributed throughout the batter.
06 - Divide the batter evenly between the prepared pans and smooth the tops with a spatula.
07 - Bake for 35 to 40 minutes, or until a toothpick inserted into the center comes out clean.
08 - Cool the cakes in the pans for 10 minutes, then turn out onto a wire rack to cool completely.
09 - Beat the cream cheese and butter together until smooth and creamy. Gradually add powdered sugar, vanilla, and salt, beating until fluffy and spreadable.
10 - Once cakes are completely cool, spread a layer of frosting on top of one cake layer. Place the second layer on top and frost the top and sides of the cake evenly.
11 - Garnish with additional chopped walnuts or carrot curls as desired. Slice and serve.