user30341: I am receiving this error after reinstalling Arduino IDE (everything was working fine [same components, same code]):

Board nodemcuv2 (platform esp8266, package esp8266) is unknown

I have recently reinstalled ESP8266 libraries. Could that have caused this issue?

user30341: 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.

30341: <p>I am receiving this error after reinstalling Arduino IDE (everything was working fine [same components, same code]):</p>

<blockquote>
  <p>Board nodemcuv2 (platform esp8266, package esp8266) is unknown</p>
</blockquote>

<p>I have recently reinstalled ESP8266 libraries. Could that have caused this issue?</p>
 30341: <p>Did some digging and found a solution that worked for me:</p>

<p>Uninstall (by logically deleting folders) and reinstall ESP Libraries.</p>

<p>Open Arduino IDE
Go to FILE -> PREFERENCES</p>

<p><a href="https://i.stack.imgur.com/k5Ghz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k5Ghz.jpg" alt="enter image description here"></a></p>

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

<p><a href="https://i.stack.imgur.com/z27OA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z27OA.jpg" alt="enter image description here"></a></p>

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

<p>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</p>

<p>Run compile and your problem should be fixed.</p>
