Preheat the oven to 350° Fahrenheit. Line two baking sheets with parchment paper and set aside.
In a large bowl, beat the butter, brown sugar and granulated sugar together on medium-high for about 2 minutes, until light and fluffy. Scrape down the sides and bottom of the bowl and add the egg and vanilla. Mix again until combined.
In a medium bowl, whisk together the flour, baking soda, baking powder, cinnamon, nutmeg and salt. Add the flour to the butter mixture and mix until just barely combined.
Add the carrots and, if desired, nuts and mix until just combined. Cover the bowl and chill for 30 minutes.
Scoop the dough onto the baking sheet in 1 ¼ inch sized balls, leaving 2 inches between them. Bake for 11-12 minutes, until the edges are set but the center is still soft. Allow the cookies to sit on the baking sheet for 3-5 minutes before transferring them to a cooling rack to finish cooling.
While the cookies cool, make the glaze by beating together the cream cheese and butter. Add the powdered sugar, vanilla extract and salt. Beat until combined. Add the milk and mix until smooth and soft.
Once the cookies are cooled, add the glaze to a ziplock bag and use scissors to snip a small piece of the corner off. Use the bag to pipe the glaze over the cookies. These cookies are best served fresh.