Preheat the oven to 400°F. Prick sweet potatoes with a fork and bake until tender, about 45-50 minutes.
Remove the sweet potatoes from the oven, let cool slightly, peel, and mash the flesh until smooth.
In a large bowl, combine the mashed sweet potatoes, egg, cinnamon, nutmeg, and salt. Gradually add flour until a soft dough forms. If sticky, add 1 more tablespoon of flour at a time until dough is easier to work with.
Turn the dough out onto a floured surface and knead gently, adding flour as needed to prevent sticking.
Divide the dough into 4 pieces. Roll each piece into a long rope, about 1/2 inch in diameter, and cut into 1-inch pieces.
Bring a large pot of salted water to a boil. Cook gnocchi in batches until they float to the surface, about 2-3 minutes. Remove with a slotted spoon. Serve as desired.