1️⃣ Preheat oven to 350°F. Grease and line two 9-inch round cake pans with parchment.
2️⃣ In a medium bowl, whisk together flour, baking powder, baking soda, salt, and spices.
3️⃣ In a large bowl, beat oil, granulated sugar, and brown sugar until well combined. Add eggs one at a time, mixing after each. Stir in vanilla.
4️⃣ Add dry ingredients to wet ingredients and mix just until combined. Fold in carrots, pineapple, and nuts if using.
5️⃣ Divide batter evenly between prepared pans. Bake 30–35 minutes, or until a toothpick comes out clean. Cool completely.
6️⃣ For the frosting: beat cream cheese and butter together until smooth. Add powdered sugar, vanilla, and salt, and beat until fluffy.
7️⃣ Frost cooled cake and garnish with extra nuts or a sprinkle of cinnamon if desired.