Preheat oven to 350°F (175°C). Grease and line two 9-inch pans or one 9×13-inch dish.
In a large bowl, whisk flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
In another bowl, whisk sugars and oil until smooth. Add eggs one at a time.
Gradually mix dry ingredients into wet mixture until just combined.
Add grated carrots, drained pineapple, and coconut.
Pour batter evenly into pans and bake for 30–35 minutes or until a toothpick comes out clean.
Let cool in pans for 10–15 minutes, then transfer to a rack to cool fully.
Beat cream cheese and butter until fluffy. Add sugar, vanilla, and milk or pineapple juice.
Spread frosting evenly and garnish with toasted coconut or nuts.
