Preheat the oven to 350°F. Line a baking sheet with parchment paper and set it aside.
Using a stand mixer, or a medium-sized mixing bowl and a handheld mixer on medium-high speed, beat the butter for 1 to 1½ minutes.
Add the granulated and brown sugars to the butter and continue to mix on medium-high for 1 more minute.
Lower the mixer speed to low, add the vanilla and 1 egg at a time, mixing well after each egg.
In a medium-sized mixing bowl, whisk together the all-purpose flour, spices, and baking soda.
Keeping the mixer speed on low, slowly add the flour mixture. Mix just until the ingredients are incorporated.
Keeping the mixer speed on low, add the finely shredded carrots and chopped pecans to the batter. Only mix until the carrots and pecans are well incorporated.
Using a 1½ tablespoon cookie scoop, scoop the cookie batter onto the prepared cookie sheet, spacing the cookies 2 inches apart.
Bake for 10 to 12 minutes.
Allow the cookies to completely cool.