Preheat oven to 350°F and grease a 9x13 inch baking pan.
In a large bowl, whisk together the flour, baking powder, cinnamon, ginger, nutmeg, and salt.
In another bowl, mix together the sugar and oil until well combined.
Add the eggs one at a time and mix until smooth. Combine wet & dry ingredients.
Gently stir in the grated carrots and chopped walnuts (if using).
Pour the batter into the prepared baking pan and spread it evenly.
Bake for 35-40 minutes, or until a toothpick inserted into the center comes out clean.
Allow the cake to cool completely before frosting.
To make the cream cheese frosting, beat together the cream cheese and butter until smooth. Gradually add in powdered sugar and mix until light and fluffy. Finally, stir in vanilla extract.
Spread the frosting & walnuts over the cooled cake.