Preheat the oven to 350°F (175°C). Line a 12-cup muffin pan with cupcake liners.
In a large bowl, whisk together the all-purpose flour, sugar, baking soda, cinnamon, salt, ground cardamom, and grated nutmeg.
In a separate bowl, whisk the egg, applesauce, olive or vegetable oil, mashed banana, crushed pineapple (undrained), and vanilla until evenly combined.
Pour the wet ingredients into the dry ingredients and stir with a spatula or spoon until just combined, scraping the bowl. Do not overmix.
If using pecans, set aside a small amount for topping and stir the remaining chopped pecans into the batter.
Scoop the batter into the prepared muffin cups, filling each about 3/4 full.
Bake for 18–20 minutes, or until a toothpick inserted into the center of a cupcake comes out clean or with a few moist crumbs.
Let the cupcakes cool in the pan for about 5 minutes, then transfer them to a wire rack to cool completely before frosting.
To make the frosting, use a hand mixer to beat the softened cream cheese and softened butter together until smooth.
Add the vanilla and the powdered sugar (start with the 1 cup listed and add more to taste) and beat until the frosting is light and fluffy and reaches your desired sweetness and consistency.
Frost the cooled cupcakes (pipe or spread the frosting) and sprinkle the reserved chopped pecans on top if using.