1pound (455 grams)cream cheese, at room temperature
1/2cup (4 ounces/115 grams)unsalted butter, cut into small pieces (at room temperature)
1 1/4cups (4 1/4 ounces/160 grams)powdered sugar
1cup (7 ounces/220 grams)packed dark brown sugar
1teaspoonpure vanilla extract
Make the cake
Preheat the oven to 350°F (177°C) and arrange a rack in the middle. Coat two 8-in/20-cm round cake pans with butter and flour and tap out any excess flour; set aside. Combine the 2 1/4 cups/288 g flour, baking powder, baking soda, salt, and allspice in a large bowl, and whisk to aerate and break up any lumps; set aside.
Combine the eggs, granulated and brown sugars, oil, and vanilla in another large bowl. Whisk until the eggs are broken up and the mixture is thoroughly combined. Using a rubber spatula, fold in the flour mixture until just combined. Fold in the carrots and 1 1/2 cups of the pistachios until evenly mixed.
Divide the batter evenly between the prepared pans. Bake until a cake tester inserted in the centers comes out clean, 40 to 50 minutes. Remove cakes from the oven, run a knife around the perimeter of each, and turn the cakes out onto wire rack to cool completely.
Make the frosting
Put the cream cheese in the bowl of a stand mixer fitted with the paddle attachment. Beat on medium speed until very smooth. Add the butter, powdered sugar, brown sugar, vanilla, and salt and beat until airy and well combined.
Frost the cake
Place a cake layer on an inverted cake pan. Spread about one-third of the frosting over the top of the layer. Stack the second layer, and evenly spread another one-third of the frosting over the top and sides of the whole cake. (Don’t fuss over looks at this point, as this is just a base-coat.)
Place the coated cake in the refrigerator until the frosting is set up and slightly hard, 10 to 15 minutes. Remove from the refrigerator and spread the remaining frosting over the top and sides of the cake, ensuring it’s as even as possible. Press the remaining 1 cup of pistachios into the sides and on the top of the cake and let the cake sit at room temperature 5 minutes before slicing with a knife dipped in hot water.