Preheat oven to 350F and lightly spray a 9-inch square pan with non-stick cooking spray and line the bottom and sides with slightly overhanging parchment paper.
In a small bowl, whisk together the flour, baking soda, baking powder, salt and spices. Set aside.
In a small bowl or measuring cup, stir together the almond milk and lemon juice. Let sit for 5 minutes until the milk curdles.
In a large bowl, whisk together the sugars, curdled milk, oil, egg and vanilla.
Add the dry ingredients to the wet mixture and whisk until the batter is smooth (but don't over mix).
Fold in the carrots and walnuts.
Pour the batter into the prepared pan and bake for 23-25 minutes, or until a toothpick inserted into the center comes out clean.
Let the cake cool completely in the pan.
Add the cream cheese and butter to a deep mixing bowl and beat on high until creamed together.
Add the powdered sugar and vanilla and beat until smooth and creamy. (Use more powdered sugar for a thicker and sweeter frosting).
Spread the frosting onto the cooled cake and top with chopped walnuts (optional).
Refrigerate for 1-2 hours before slicing and serving.
Notes
Freshly grate your carrots by using the small holes on a box grater. Avoid larger shreds or prepackaged shredded carrots which can be dry.
Walnuts are optional. Leave them out or use pecans instead.
Make sure your butter and cream cheese are softened at room temperature so they cream together easily and create a smooth texture for the frosting.
I like my cream cheese frosting less sweet with a more pronounced cream cheese flavor so I use about 2 - 2 ½ cups of powdered sugar. For a sweeter and thicker frosting, just add more powdered sugar.
Let the cake cool completely before frosting. If the cake is still warm, the cream cheese frosting will start to melt as you spread it on.