Yep I can reproduce that, as soon as #include <ESP8266WiFi.h>
is done, the compiler throws these errors. Hm now it get’s really hard if the compiler isn’t able to compile the framework’s library anymore.
I’d suggest you try and find the minimal code that reproduces the error, and then also check in the Arduino IDE if it fails to compile for a NodeMCUv2.
This error was also encountered in Possible to use C++17 - #4 by maxgerhardt but for Arduino-ESP32 where these errors were fixed by modifying the libraries. Arduino-ESP8266 has no such branch, but for the future an issue there would probably be good, so that it may at some point use a better compiler…