Preheat your oven to 350 degrees F. Grease an 8-inch round or square, 9-inch round, or 6-inch** round cake pan. Line the bottom of the pan with parchment paper, to give extra insurance that the cake will come out cleanly. Just trace the bottom of the pan on a sheet of parchment paper and cut it out, then place inside the pan.
In a medium bowl, whisk the dry ingredients: flour, baking powder, baking soda, cinnamon, nutmeg, and salt. Set aside.
In a large microwave-safe bowl (I use a large glass bowl), or on the stove, melt the butter. Let it sit for a couple minutes to cool, then whisk in the brown sugar, followed by the eggs one at a time, until combined and smooth.
Dump the dry ingredients into the bowl with the wet ingredients and stir together until well-combined and no lumps remain.
Fold in the carrots and shredded coconut until evenly distributed.
Pour the batter into the prepared pan, smooth out the surface, and bake for 28-32 minutes if using a 9-inch round pan, or 32-34 minutes if using an 8-inch round or square pan, until cake springs back when touched and a tester inserted in the center comes out clean or with a few moist crumbs attached. (**See notes for 6-inch cake instructions).
Let cake cool in pan on a rack for 10 minutes, then invert the pan onto the rack to release the cake, remove the parchment from the bottom, and flip back right side up onto a cake plate. Let cake cool while you prepare the frosting.
In a large bowl using a stand mixer with the whisk attachment, or a hand mixer, beat cream cheese and butter at high speed until pale and very fluffy - this should take 2-3 minutes. You want to incorporate as much air as possible into the mixture to make it light and fluffy.
Add the powdered sugar, vanilla, and salt, and beat at medium to high speed until fully combined and light.
Spread cooled cake with cream cheese frosting. It should make a thick layer, and can be swirled in pretty patterns with an offset spatula (I like this one).
Decorate the outer edges of cake with additional grated carrots and chopped walnuts or pecans if desired. Serve!
