Preheat your oven to 180°C (355°F). Line an 8 inch (20 cm) loaf pan with parchment paper.
Add all the dry ingredients to a large mixing bowl and whisk until there are no lumps. Add all the wet ingredients (including the carrots and optional nuts) and mix until just combined. Initially, the batter will be thick, but it will loosen after a couple of minutes as the carrot and sugar will soften.
Pour the batter into your prepared loaf pan.
Bake the cake for around 60-65 minutes or until you can insert a toothpick in the center of the loaf and it comes out clean. A few moist crumbs on your toothpick are fine but make sure there's no wet batter on it.
Allow the cake to cool in the pan for 10 minutes then transfer to a wire rack.
Add the vegan butter to a large bowl or the bowl of a stand mixer with the paddle attachment. Beat until it's light and fluffy. Add the vegan cream cheese and beat until there are no lumps.
Add the sugar and vanilla extract and beat until just combined. If your frosting is too runny, add a little more powdered sugar or a few tablespoons of cornstarch. Chill the frosting until needed.
When the loaf has completely cooled, spread the frosting on top. Sprinkle with chopped walnuts or pecans, or as desired.
Slice and serve the loaf at room temperature.
Store the unfrosted loaf in an airtight container at room temperature for up to 2 days. If you topped your loaf with cream cheese frosting, you can store it at room temperature for 1-2 hours or in the fridge for around 2 days. Allow the cake to come to room temperature before serving. If you used regular buttercream, store the cake at room temperature for 1-2 days.
