Arduino IDE: Board nodemcuv2 (platform esp8266, package esp8266) is unknown
Did some digging and found a solution that worked for me:

Uninstall (by logically deleting folders) and reinstall ESP Libraries.

Open Arduino IDE
Go to FILE -> PREFERENCES



Open the preferences folder (this works in Linux, Mac and Windows) 
Go to PACKAGES > ESP8266 > HARDWARE > ESP8266



Delete all libraries (if your issue is similar to mine and to others', you should have 2 or more folders, with different versions).

Restart Arduino IDE.
Go to SKETCH > INCLUDE LIBRARY > MANAGE LIBRARIES
Install ESP8266 Community 
Go to TOOLS > BOARD and scroll down to your model of NODEMCU

Run compile and your problem should be fixed.