Preheat oven to 350 °F (175 °C). Grease or line a 9×5-inch loaf pan with parchment paper.
In a bowl, whisk together the flour, baking powder, (and baking soda if using), cinnamon, ginger, nutmeg, and salt.
In another bowl, mix together the sugar, oil (or butter), and eggs until smooth.
Stir the wet ingredients into dry until just combined. Fold in grated carrots and nuts (if using).
Pour batter into prepared pan. Bake for about 50–60 minutes, or until a toothpick inserted into the center comes out clean.
Let cool in pan for 10 minutes, then remove loaf to wire rack to cool completely before frosting (if desired).
For frosting: beat together cream cheese and butter until smooth. Gradually add powdered sugar and vanilla, mixing until creamy. Spread over cooled loaf.
Notes
This loaf is customizable—add raisins, pineapple, coconut, or spice variations as you like. Toasted or finely ground nuts add texture and flavor. Let the cake cool before frosting.