How to make a 5-volt relay work with NodeMCU?
I have several of these modules. They have an optional opto-isolator built-in, but you have to remove the jumper to use it.


Connect your GPIO trigger as you have it
Run the relay's Vcc and Gnd pins to the MCU, not the power plug.
connect the power plug's +5v to the left-most pin, where the jumper once stood: JDVcc
connect the power plug ground to the MCU or the open common Gnd on the left-group of pins.


Now your relay coil(s) will be powered by the 5v plug, but the relay's logic and control are handled by the MCU.