Preheat oven to 350 degrees F. Grease two (12-cavity) cupcake tins. I used cooking spray. You can also line them with cupcake liners.
In a medium bowl, whisk together the flour, baking soda, cinnamon, ginger, black pepper, cloves and salt. Set the dry mixture aside.
In the bowl of a stand-up mixer, with the paddle attachment, add the butter, white sugar and brown sugar; beat until nice and fluffy, about 2 to 3 minutes. Pour in the oil and eggs. Beat until combined.
Alternating between the buttermilk and the dry mix, add them to the butter mixture, until just combined. Lastly, add the carrots and walnuts and mix until thoroughly distributed throughout the batter.
To fill up the cupcake tin, I used a cookie scoop to make it easy on myself. Fill each cupcake tin about half way. I baked these in batches because doing two at the same time didn’t end well for me. Transfer the first cupcake tin to the oven and bake for 20 to 25 minutes, until a skewer inserted into the center comes out clean. Repeat with the second batch of batter.
Allow them to cool in the pan for about 5 minutes and then transfer them to a cooling rack to cool before adding the frosting.