Preheat the oven to 350°F (175°C). Line a 12-cup muffin tin with cupcake liners and set aside.
In a medium bowl, whisk together the flour, baking powder, baking soda, salt, and cinnamon. Set aside.
In a large bowl, whisk together the oil, eggs, sugar, and vanilla extract until smooth and well combined.
Stir in the grated carrots and drained crushed pineapple until fully incorporated. If you’re adding walnuts, fold them in at this stage.
Gradually add the dry ingredients to the wet ingredients, stirring just until combined. Be careful not to overmix.
Spoon the batter into the cupcake liners, filling each about 2/3 of the way full. Use an ice cream scoop perfect measure every time!
Bake for 18-22 minutes, or until a toothpick inserted into the center of a cupcake comes out clean.
Let the cupcakes cool in the pan for 5 minutes, then transfer them to a wire rack to cool completely.
While the cupcakes cool, beat the cream cheese and butter together until smooth and creamy. Gradually add the powdered sugar, vanilla extract, and a pinch of salt. Beat until the frosting is light and fluffy.
Frost the cupcakes: Once the cupcakes have cooled, spread or pipe the cream cheese frosting onto each cupcake.