Preheat oven to 350°F (175°C). Grease a 9x13-inch baking dish.
Boil sweet potatoes until tender, about 15–20 minutes. Drain and mash until smooth.
Stir in butter, sugar, eggs, milk, vanilla, cinnamon, nutmeg, and salt. Mix well.
Spread sweet potato mixture evenly into the baking dish.
In a bowl, combine pecans, flour, brown sugar, and butter. Stir to form a crumbly topping.
Sprinkle topping over sweet potatoes.
Bake uncovered for 30–35 minutes, until golden brown and set.
Let cool slightly before serving.