Preheat your oven to 350°F (175°C). Grease a 9-by-13-inch baking pan or line it with parchment paper. If you prefer a layered cake, prepare two 8-inch round cake pans instead.
In a medium bowl, whisk together the flour, baking powder, baking soda, cinnamon, ginger, nutmeg, cloves, and salt. Mixing the dry ingredients first helps distribute the spices and leavening agents evenly throughout the cake.
In a large bowl, whisk the granulated sugar, brown sugar, pumpkin puree, vegetable oil, eggs, and vanilla extract until smooth. Make sure the pumpkin puree is evenly incorporated before adding the dry ingredients.
Gradually add the dry mixture to the wet ingredients. Stir gently with a spatula or whisk until everything is just combined. Avoid overmixing, as excessive mixing can make the finished cake dense rather than tender.
Pour the batter into the prepared pan and spread it evenly. Bake for approximately 30–35 minutes, checking for doneness near the end of the baking time. Insert a toothpick into the center; if it comes out clean or with a few moist crumbs, the cake is ready.
Remove the cake from the oven and let it cool in the pan for about 10–15 minutes. Transfer it to a cooling rack if needed and allow it to cool completely before adding the frosting. Frosting a warm cake can cause the topping to melt.
Beat the softened cream cheese and butter until smooth and creamy. Gradually add the powdered sugar, followed by the vanilla extract and optional cinnamon. Continue beating until the frosting is fluffy and easy to spread.
Spread the frosting evenly over the cooled cake. Sprinkle a little cinnamon on top for decoration, or add chopped pecans or walnuts if desired. Slice into 12 portions and serve with coffee, tea, or your favorite warm beverage.