Heat the oven to 350ºF. Coat a 9x13-inch baking pan with cooking spray.
Whisk 2 cups all-purpose flour, 2 teaspoons ground cinnamon, 1 ½ teaspoons baking powder, 1 teaspoon baking soda, ½ teaspoon ground ginger, and ½ teaspoon ground nutmeg together in a medium bowl.
Beat 1 cup melted unsalted butter, 1 cup granulated sugar, and 1 cup packed brown sugar together in a stand mixer with the paddle attachment on medium speed until light and fluffy, about 2 minutes.
Beat in 4 large eggs one at a time, waiting until each is incorporated before adding the next. Beat in 2 cups mashed sweet potatoes, ¼ cup sour cream, and 2 teaspoons vanilla extract, scraping down the bowl as needed, about 1 minute.
Reduce the speed to low and gradually beat in the flour mixture until just incorporated. Transfer to the baking pan and smooth out the top.
Bake for 25 minutes. Rotate the baking pan and bake until a tester inserted into the center comes out clean and the edges begin to brown, 20 to 25 minutes more. Place the baking dish on a wire rack and let cool completely, about 2 hours. Meanwhile, make the frosting.
Wash and dry the stand mixer and paddle attachment. Beat 8 ounces room-temperature cream cheese, 4 tablespoons room-temperature unsalted butter, and ½ teaspoon kosher salt together in the stand mixer with the paddle attachment on medium speed until combined, about 1 minute.
Gradually beat in 3 cups powdered sugar and 1 teaspoon vanilla extract until the frosting starts to come together into lumps. Increase the speed to high and beat until fluffy and creamy, scraping down the sides of the bowl as needed, about 2 minutes more. Dollop the frosting over the cooled cake and spread into an even layer.
