Preheat the oven to 350°F (175°C) and prepare your pans with grease and flour or parchment paper.
In a large bowl, whisk flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
In another bowl, mix sugars and oil until smooth, then beat in eggs one at a time.
Gently combine wet and dry ingredients until no dry streaks remain.
Fold in grated carrots, crushed pineapple, and coconut if using.
Pour batter into pans and bake 30–35 minutes for round pans or 40–45 minutes for a 9×13 pan, until a toothpick comes out clean.
Cool for 10–15 minutes, then transfer to a wire rack to cool completely.
For frosting, beat cream cheese and butter until creamy, add powdered sugar gradually, then mix in vanilla and milk or pineapple juice until smooth.
Spread generously over the cake and top with toasted coconut, pineapple, or nuts if desired.