'PORTD' was not declared in this scope

I am currently writing a code to produce a tone on a NodeMCU and I keep getting an error message saying 'PORTD' was not declared in this scope and I cant figure out how to fix it. Here's my code.

void setup(){
pinMode(D3,OUTPUT);
}

void loop(){
playNote(568);
delay(250);
}

void playNote(int noteDelay){
int x;
for(x=0;x<100000/noteDelay;x++){
PORTD |=0x01;
delayMicroseconds(noteDelay);
PORTD &=0xFE;
delayMicroseconds(noteDelay);
}
}

You're trying to compile code for a processor that doesn't have a PORTD.

PORTD is an AVR thing. NodeMCU has an ESP8266, on which "direct port IO" is different.