Install ESP8266 core for Arduino IDE
- 1.
- 2.
Then, open the Arduino IDE, then select in the menu:
File -> Preferences
(Arduino -> Preferences
for Mac).Click on Additional Boards Manager URLs button and add this link:
http://arduino.esp8266.com/stable/package_esp8266com_index.json

In the Arduino IDE open:
Tools -> Board -> Boards Manager
.
Search for esp8266
, and install it:
In case you see Error downloading http://downloads.arduino.cc/packages/package_index.json like this:

You need to find folder
Arduino15
or .Arduino15
and remove all files inside with package word in name.