Butter, for greasing the cake pans
2 cups unbleached all-purpose flour, plus more for flouring the cake pans
2 cups granulated sugar
1 tablespoon ground cinnamon
1 teaspoon salt
2 teaspoons baking soda
2 teaspoons baking powder
4 large eggs
1½ cups canola oil
2 teaspoons pure vanilla extract
3 packed cups peeled and grated carrots (about 1 lb.)
1 cup chopped walnuts or pecans
1 cup cream cheese, softened (8 ounces)
8 tablespoons unsalted butter, softened (1 stick)
4 cups confectioners' sugar, sifted
1 tablespoon pure vanilla extract
1 tablespoon milk or water, if needed
2 cups chopped walnuts or pecans
Position a rack in the lower third of the oven and pre-heat the oven to 325°F. Heavily butter and flour 2 round 9-inch cake pans, tapping out the excess flour. Set the cake pans aside.
Place the flour, granulated sugar, cinnamon, salt, baking soda, and baking powder in a large bowl and whisk to combine.
Place the eggs, oil, and vanilla in a small bowl and whisk to combine.
Add the egg mixture to the flour mixture and stir to combine. Add the carrots and nuts and stir to combine.
Evenly divide the batter between the prepared cake pans. Bake the cakes until a toothpick inserted in the center comes out clean and the edges have pulled away from the side of the pans, 55 to 65 minutes.
Place the cake pans on wire racks and let the layers cool completely, about 1 hour.
While the cakes are cooling, make the frosting. Place the cream cheese and butter in a medium-size bowl and beat with an electric mixer until very smooth and creamy, about 3 minutes. With the mixer running on medium speed, slowly add 3 ½ cups of the confectioners' sugar and beat until it is fully incorporated and smooth, about 3 minutes. Add the vanilla and beat unit just combined. If the frosting is too soft, slowly add the remaining ½ cup of confectioners' sugar and beat to combine. If the frosting is too stiff, add the 1 tablespoon of milk or water.
Run a knife around the edge of each cake layer to loosen it from the pan. Invert the cake layers to unmold them. Place one cake layer on a plate. Spread some of the frosting on top. Place the second layer on top of the frosting and frost the side and top of the cake. Press the 2 cups of nuts onto the side of the cake.
The cake can be refrigerated, covered, for up to 1 week.