Preheat oven to 350°F and grease a 9x13-inch baking dish.
In a large bowl, combine pumpkin, sugar, oil, and eggs until smooth.
In another bowl, whisk together flour, baking powder, cinnamon, baking soda, and salt.
Gradually add the dry ingredients to the wet ingredients and mix until just combined.
Fold in dried cranberries and walnuts (if using).
Pour the batter into the prepared baking dish and spread evenly.
Bake for 20-25 minutes or until a toothpick inserted in the center comes out clean.
While the bars cool, beat cream cheese, powdered sugar, and vanilla until smooth.
Spread the frosting over the cooled bars and cut into squares to serve.