Before changing the NodeMCU, please check the functionality of your present NodeMCU by uploading the following sketch which blinks the onboard LED connected at GPIO-16/D0.
#define ledpin D0 //I am using built-in LED1 of Node at GPIO-16/D0
void setup()
{
pinMode(ledpin, OUTPUT);
Serial.begin(115200);
}
void loop()
{
digitalWrite(ledpin, HIGH);
delay(1000);
digitalWrite(ledpin, LOW);
delay(1000);
}