Prep the pans and oven. Preheat your oven to 350°F (175°C).
Grease and line three 8-inch round cake pans with parchment, or two 9-inch pans. Lightly flour the sides to help the cakes release cleanly.
Toast the pecans. Spread pecans on a baking sheet and toast in the preheated oven for 6–8 minutes until fragrant. Cool, then chop.
This step deepens the flavor and keeps them from getting soggy in the batter.
Mix the dry ingredients. In a large bowl, whisk the flour, granulated sugar, brown sugar, baking soda, cinnamon, nutmeg, and salt until well combined.
Combine the wet ingredients. In another bowl, whisk the eggs, oil, and vanilla. Stir in the mashed bananas and crushed pineapple with all its juice.
Bring it together. Pour the wet mixture into the dry ingredients. Stir gently with a spatula until just combined.
Fold in the pecans, coconut, and raisins if using. Do not overmix; a few small lumps are fine.
Divide and bake. Divide batter evenly among the pans. Bake for 23–28 minutes for 8-inch layers (28–34 minutes for two 9-inch layers), or until a toothpick comes out with a few moist crumbs.
The tops should spring back lightly.
Cool completely. Let cakes cool in the pans for 10 minutes, then turn out onto a rack, peel away parchment, and cool fully. A cool cake means your frosting won’t melt or slide.
Make the frosting. Beat the cream cheese and butter together until smooth and fluffy, about 2–3 minutes. Add vanilla and salt.
Beat in powdered sugar a cup at a time until thick, smooth, and spreadable. For a slightly stiffer frosting, add the extra sugar.
Assemble. Place the first layer on a plate. Spread an even layer of frosting to the edges.
Repeat with the second and third layers. Frost the sides and smooth the top. Press extra chopped pecans along the bottom edge or sprinkle on top.
Chill briefly, then serve. For clean slices, chill the cake for 30–45 minutes before cutting.
Add fresh banana slices or pineapple just before serving if you like.