Preheat the oven to 350°F and coat a 9x13 baking dish with cooking spray. Set aside.
In a large bowl with an electric hand mixer or a stand mixer fitted with the paddle attachment, cream together the butter and sugars until light and fluffy. Beat in the eggs and vanilla.
Sift or whisk together the baking powder, baking soda, salt, ginger, cinnamon and nutmeg. Add the flour alternately with buttermilk, scraping side of bowl. Beat 1 minute.
Stir in the squash and the walnuts or pecans.
Pour the batter into the prepared pan.
Bake for 30 to 40 minutes or until it passes the toothpick test. Cool completely.
If you've tried this recipe, come back and let us know how it was in the comments or star ratings.
Notes
*Grate butternut squash using the large holes on a box grater or the grater function on a food processor.