Preheat your oven to 350°F (175°C). Line a cupcake tin with paper liners.
In a medium bowl, whisk together the flour, baking powder, baking soda, salt, and cinnamon. Set aside.
In a large mixing bowl, combine the vegetable oil, granulated sugar, brown sugar, eggs, and vanilla extract. Mix until well combined and slightly creamy.
Gradually add the dry flour mixture to the wet mixture, stirring until just combined. Be careful not to overmix.
Fold in the grated carrots and chopped nuts (if using) until evenly distributed in the batter.
Fill each cupcake liner about ¾ full of the batter.
Bake in the preheated oven for 20-24 minutes, or until a toothpick inserted into the center of a cupcake comes out clean.
Once baked, remove the cupcakes from the oven and allow them to cool in the tin for a few minutes before transferring them to a wire rack to cool completely.
Make the cream cheese frosting: In a mixing bowl, beat the softened cream cheese and butter together until creamy and well combined.
Gradually add the powdered sugar, one cup at a time, beating well after each addition. This will ensure a smooth and creamy frosting.
Stir in the vanilla extract and mix until incorporated.
Assembly the cupcakes: Once the cupcakes are completely cooled, use a piping bag or an offset spatula to generously frost each cupcake with the cream cheese frosting.
Notes
Optionally, you can sprinkle chopped nuts on top of the frosting for decoration.