That is a problem growing squash, pumpkins etc without full sunlight.
They will grow like a bean stalk searching for sunlight.
Put some dirt around the stem to support them until you put them outside.
When you put them outside put the whole plant in the ground right up to the leaves and it will be fine when it get's the proper sunlight.
Mound up some soil for them.
The mounded soil will stay warm.