Hi,
Probably good to update to current High Sierra and iMovie 10.1.8. See if that cures it.
Aside from that, I would first try opening iMovie while holding down the Option and Command keys, and selecting to delete preferences in the box that appears.
If the above doesn't cure it, there likely is some corruption in the project. You might try copying your media into a newly created project and see if it shares out.
Failing that, you will need to locate the corruption in the project and remove it. Could be a corrupt font in a title, a transition, a bad frame in a clip, clips with varying frame rates and/or formats, and audio issue, etc. To isolate the problem, try duplicating your project and sharing out half of it. If it shares out O.K, the corruption is in the other half. Duplicate your project again and share out half of the corrupted half. Keep doing this until you have isolated the issue to a manageable range of clips. Then scroll through them frame by frame, using the arrow key on your keyboard, and look for things like flashes, black frames, pixelation, and anything else that looks suspicious. Change fonts in titles. Change transitions. If you find something, delete it and try sharing out again.
Grunt work, I know.
-- Rich