Preheat oven to 350°F (175°C).
Grease and flour two 9-inch round cake pans (or line with parchment paper).
In a large bowl, whisk together flour, sugar, baking soda, cinnamon, nutmeg, and salt.
Stir in eggs, oil, and vanilla extract until combined.
Add mashed bananas, crushed pineapple (with juice), and chopped pecans.
Mix gently until just combined—don’t overmix!
Divide batter evenly between the cake pans.
Bake for 25-30 minutes, or until a toothpick comes out clean.
Let cakes cool in the pans for 10 minutes, then transfer to a wire rack.
Beat cream cheese and butter until smooth.
Add powdered sugar and vanilla and beat until fluffy.
Spread frosting between layers, then frost the outside.
Garnish with chopped pecans and fresh pineapple if desired.
Refrigerate for 30 minutes before slicing for the best texture.
