Preheat your oven to 350°F (175°C). Line a baking sheet with parchment paper or a silicone baking mat.
In a medium bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, and nutmeg. Set aside.
In a large mixing bowl, cream the softened butter, granulated sugar, and brown sugar together until light and fluffy, about 2–3 minutes. Beat in the egg and vanilla extract until fully combined.
Gradually add the dry ingredients to the wet ingredients, mixing on low speed just until combined. Fold in the shredded carrots, chopped nuts, and raisins or coconut (if using).
Use a cookie scoop or tablespoon to drop rounded balls of dough onto the prepared baking sheet, spacing them about 2 inches apart. Bake for 10–12 minutes, or until the edges are lightly golden.
Allow the cookies to cool on the baking sheet for 5 minutes before transferring them to a wire rack to cool completely. Prepare the cream cheese frosting by beating the softened cream cheese and butter together until smooth. Add the powdered sugar, vanilla extract, and salt, and beat until light and fluffy.
Once the cookies are completely cool, pipe or spread a dollop of frosting onto each cookie. Garnish with a sprinkle of cinnamon or chopped nuts, if desired. Serve at room temperature.
