Preheat oven to 350°F (175°C). Grease and line a 9x5-inch loaf pan with parchment paper.
In a medium bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
In a large bowl, whisk oil, brown sugar, eggs, and vanilla until smooth.
Stir in grated carrots and crushed pineapple (if using).
Fold dry ingredients into the wet mixture until just combined. Stir in chopped nuts if using.
Pour the batter into the prepared loaf pan and smooth the top. Bake for 50–60 minutes, or until a toothpick inserted in the center comes out clean.
Let the loaf cool in the pan for 10 minutes, then transfer to a wire rack to cool completely.
While the loaf cools, make the frosting by beating cream cheese, butter, powdered sugar, and vanilla until smooth.
Spread frosting over the cooled loaf. Garnish with chopped nuts or a sprinkle of cinnamon, if desired.