My guess is that you’re using an inappropriate GPIO, and possibly confusing the NodeMCU PIN numbers with GPIOs. You should read this:
Pete.