Preheat oven to 350°F. Grease two 9-inch round cake pans and line the bottoms with parchment paper.
Peel and grate fresh carrots using a box grater or food processor. Don’t squeeze out the moisture.
In a large bowl, whisk flour, baking powder, baking soda, salt, cinnamon, ginger, and nutmeg until evenly combined.
In another bowl, whisk oil, brown sugar, granulated sugar, eggs, applesauce, and vanilla until smooth.
Stir grated carrots into the wet mixture. Fold in nuts, raisins, or drained pineapple if using.
Add the wet mixture to the dry ingredients and fold gently until no flour streaks remain. Do not overmix.
Divide batter between the pans. Bake for 30–35 minutes, or until a toothpick comes out clean or with a few moist crumbs.
Let cakes cool in the pans for 15–20 minutes, then transfer to a wire rack. Cool fully before frosting.
Beat cream cheese and butter until smooth. Add powdered sugar, vanilla, and salt, then beat until creamy and spreadable.
Layer and frost the cake. Add chopped pecans or a pinch of cinnamon if desired, then slice and serve.