Prepare the sweet potatoes by washing, peeling, and cutting them into chunks. Boil for 15-20 minutes until tender, then mash until smooth.
Make the crust by combining melted butter and flour until crumbly. Press into the bottom of a greased baking dish if desired.
Mix the filling by combining mashed sweet potatoes, sugars, vanilla, spices, and salt. Add eggs one at a time, then gradually mix in evaporated milk until smooth.
Assemble the bars by spreading the filling over the crust or pouring it directly into the greased dish. Sprinkle pecans on top if using.
Preheat oven to 350°F. Bake for 30-35 minutes until a toothpick comes out clean. Cool for at least 15 minutes before cutting into squares.