I know it’s really easy to say this (and much more difficult for you in practice), but If you overreact to his undesirable behavior, you may actually be reinforcing it—so he does it more and more. When he does it again, stay calm, wash both your hands, and simply say "no, don't do that anymore please". You need to focus on calmly and clearly letting him know that you do not want him to do it, but then don’t react further. anyone else having to deal with it needs to react identically- clear expression that you do not want this behaviour, but in a very calm and unflappable way.
I know it’s really hard for you not to get upset/frustrated when he does it, but by having such a strong reaction, you could turn what is likely to be a normal, temporary developmental phase into a long-term problem. Instead of making a big deal out of the vomiting,
stay calm, clean up, and pretend that nothing happened.
If you can, distract him and keep his hands busy if it seems like he is getting ready to do it. As much as you are able, stick to a routine for meals,any naps (wishful thinking?!), and bedtime to make sure that stress isn't contributing to this behaviour.
If it’s stress relating to not wanting to do certain things- think of any way to compromise every way you can, so that he feels that he has a choice (offer him two different T-shirt’s to wear, two breakfast options, sweets
or a magazine when you pick him up etc so he feels more in control), and if you can anticipate something he might not like and you can’t avoid (childminder) spend as much time preparing him as you can (talking about it the night before, mentioning it again two or three times in the morning, telling him how proud of him you are that he’s being such a big boy..etc.) and asking him questions involving choice I.e “Who are you going to play with first when you get there? What game do you think you’ll get out to play with first?”
Focus on making him feel that he is the master of his own destiny as much as you can - give him options and ask him questions
- “I know you don’t like pasta very much but which do you think is better? Pasta with cheese on top or maybe pasta with some tomato sauce?“ Let him decide which is better and let him have it that way. If you aren’t able to offer a choice with his meal that day, let him choose the serving dish or something -does he want a big adult-sized plate or a little bowl- maybe just two little bowls and a big fork, or a small spoon? You get the idea....give him choices for everything, so you are rarely just imposing a decision on him. (You are obvs brighter than him so make it easy in yourself, and it’s unlikely to last forever.,,you aren’t making a monster). So what if he eats his pasta out of drinking cup with chopsticks; he’s eating the meal you made and not making himself sick in protest? Who’s the real winner?
What you want to avoid when you can, just until you have the sickness more under control, is “
Shame you don’t like pasta, tough luck that’s all there is sunshine.” For every scenario like this you have left him with either option a - comply, or option b- be sick (in his eyes).
If it continues (especially if he stops eating, is not gaining weight well, or is often fussy) I’d get to your GP for more specialist advice.