Preheat your oven to 350°F (175°C). Grease and flour a 9-inch round cake pan or two 8-inch cake pans.
In a medium bowl, whisk together the flour, baking soda, baking powder, cinnamon, nutmeg, and salt. Set aside.
In a large bowl, whisk the eggs, sugar, oil, and vanilla extract together until smooth.
Stir in the grated carrots and the drained crushed pineapple (reserve a small amount of the juice if you want to add it to the frosting or glaze later).
Gradually add the dry ingredients into the wet ingredients, mixing until just combined. If using, fold in the chopped nuts and shredded coconut.
Pour the batter into the prepared pan(s). Bake for 30-35 minutes (for one 9-inch pan) or 25-30 minutes (for two 8-inch pans), or until a toothpick inserted into the center of the cake comes out clean.
Let the cake cool in the pan for 10 minutes before transferring it to a wire rack to cool completely.
In a medium bowl, beat the cream cheese and butter together until smooth and creamy.
Gradually add the powdered sugar, one cup at a time, beating until smooth.
Stir in the vanilla extract and a pinch of salt.
Once the cake has cooled, spread the frosting evenly over the top. If desired, sprinkle some additional chopped nuts or shredded coconut on top for garnish.