Melt butter in a medium saucepan over medium heat. When it turns a light golden color, remove from heat and immediately add brown sugar. Whisk for 3 minutes until smooth.
Let the butter and sugar mixture cool for 10 minutes.
Grate the carrots, then stir them into the butter-sugar mixture. Stir in the egg and vanilla.
Stir in flour and salt. Add cinnamon and pecans, if using.
Line an 8x8 baking pan with parchment paper. Pour the batter into the pan and spread evenly to the edges. Bake for 19–23 minutes. Let cool completely.
For the frosting, cream together softened cream cheese and butter for 2 minutes.
Add powdered sugar and vanilla, then whip for 2 minutes longer.
Once the bars have cooled, frost with the cream cheese frosting and sprinkle with chopped pecans.
Chill before cutting for cleaner slices.
Notes
Storage: Store in an airtight container in the refrigerator for up to 5 days.