nodemcu esp8266 does not boot up when 5V pin is connected as a VIN source Whenever I boot up the esp8266 or flash code via usb ,I have to remove vin pin otherwise it does not boot up.

If I remove vin pin then flash and boot up happens and then i am able connect vin with 5 V relay.(using VIN to power up relay) .

I dont understand what it has to do with VIN pin.please suggest.

I am using below pins for eight devices

//relay pin setup for funct
int relayOne = 5;
int relayTwo = 4;
int relayThree = 0;
int relayFour = 2;
int relayFive = 14;
int relaySix = 12;
int relaySeven = 13;
int relayEight = 15;
IO pins 0, 2 and 15 are boot configuration pins. 15 must be LOW at boot, 2 must not be LOW at boot and 0 determines the flashing mode. For normal run pin 0 must be HIGH. The NodeMcu board has necessary pull-up and pull-down circuits.

You can connect to pins 0, 2 and 15 only devices which don't change the boot state.