Adjust oven rack to middle position and heat oven to 350 degrees F. Line standard muffin tin with cupcake liners, lightly spray with baking spray (Tip: spray in short bursts with your arm lifted away from the pan to keep the blast of air from sending the liners flying everywhere).
Place walnuts on a baking sheet and toast until golden and fragrant, shaking the pan once or twice, 5-7 minutes. Once the nuts are cool enough to handle, chop finely.
In a medium sized bowl, whisk together the flour, salt, cinnamon, allspice, baking powder, and baking soda. In a large bowl, whisk together the butter, granulated sugar, brown sugar, and eggs. Mix in the dry ingredients along with the toasted nuts and carrots until evenly combined.
Divide batter evenly among the cupcake liners. Bake until a toothpick inserted into one of the middle cupcakes comes out clean, 19-22 minutes. Cool for 5 minutes, then carefully remove from the pan to a wire rack and cool completely. Once at room temperature, frost with cream cheese frosting.
Unfrosted cupcakes can be stored in an airtight container at room temperature for up to 3 days. (They can also be individually wrapped in plastic and frozen in a zipper-lock bag for up to 1 month.) Frosted cupcakes should be stored in the refrigerator and will keep for 5-7 days (but taste best within 3 days).