Preheat your oven to 350°F (175°C) and line a baking sheet with parchment paper.
In a bowl, whisk together flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
In a separate bowl, cream together the softened butter, brown sugar, and granulated sugar until light and fluffy.
Add the egg to the butter mixture and beat until well combined.
Gradually add the dry ingredients to the wet ingredients, mixing until just combined.
Fold in the grated carrots and walnuts, if using.
Drop tablespoons of dough onto the prepared baking sheet, spacing them about 2 inches apart.
Bake for 12-15 minutes or until the edges are lightly golden.
Allow cookies to cool on the baking sheet for 5 minutes before transferring to a wire rack.
Dust with powdered sugar before serving.