01 - Preheat oven to 350°F. Grease and flour two 8-inch round cake pans or one 9x13-inch rectangular pan.
02 - In a medium bowl, whisk together the all-purpose flour, baking powder, baking soda, ground cinnamon, ground nutmeg, and salt until evenly distributed.
03 - In a large bowl, beat the eggs, granulated sugar, and packed light brown sugar until smooth and well combined. Add the vegetable oil and vanilla extract, mixing thoroughly.
04 - Gradually fold the dry ingredient mixture into the wet ingredients, stirring until just combined. Do not overmix.
05 - Gently fold in the grated carrots, chopped nuts, and drained crushed pineapple if using, distributing evenly throughout the batter.
06 - Pour the batter into the prepared pan(s) and smooth the top with a spatula to ensure an even layer.
07 - Bake for 35 to 40 minutes, or until a toothpick inserted into the center comes out clean. Let the cake cool completely in the pan(s) on a wire rack.
08 - In a mixing bowl, beat the softened cream cheese and unsalted butter together until light and fluffy. Gradually add the sifted powdered sugar, vanilla extract, and a pinch of salt, beating until smooth and creamy.
09 - Spread the cream cheese frosting evenly over the completely cooled cake. If using layered rounds, frost between the layers and cover the top and sides evenly.