Preheat the oven to 350°F. Line two large baking sheets with parchment paper.
In a medium bowl, whisk together the flour, baking soda, salt, cinnamon, ginger, and nutmeg. Set aside.
In a large mixing bowl using a hand mixer or stand mixer with the paddle attachment, beat the butter and both sugars together on medium speed until light and fluffy, about 3 minutes. Add the egg and vanilla, and beat until well combined. Scrape the bowl down.
With the mixer on low speed, add the dry mixture and mix until almost combined. Add the shredded carrots, oats, and pecans (if using), and mix on low until just combined.
Scoop the dough into 1½ tablespoon-sized dough balls (about 35g each), and place on the prepared cookie sheets about 2 inches apart.
Bake for about 12 minutes or until the edges are golden brown. The centers will still be soft, but you can bake for 2 to 3 more minutes for a crispier cookie. Let the cookies cool on the pan for a few minutes, then transfer to a wire rack to cool completely.
In a large mixing bowl using a hand mixer or stand mixer with the paddle attachment, beat the cream cheese and butter on medium speed until very smooth, about 1 minutes. With the mixer on low, gradually add the powdered sugar. Once combined, scrape down the bowl, add the vanilla, and beat on medium speed until fluffy, about 1 minutes.
Spread the cream cheese frosting on top of each cooled cookie before serving.
