Error uploading to ESP8266 board

Arduino: 1.8.5 (Windows 7), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600”

Archiving built core (caching) in: C:\Users\Andreea\AppData\Local\Temp\arduino_cache_467382\core\core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,FlashSize_4M1M,LwIPVariant_v2mss536,Debug_Disabled,DebugLevel_None____,FlashErase_none,UploadSpeed_921600_626c7d52cd5e811e9a17fc606e6426cb.a
Sketch uses 247383 bytes (23%) of program storage space. Maximum is 1044464 bytes.
Global variables use 32332 bytes (39%) of dynamic memory, leaving 49588 bytes for local variables. Maximum is 81920 bytes.
C:\Users\Andreea\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.13/esptool.exe -vv -cd nodemcu -cb 921600 -cp COM1 -ca 0x00000 -cf C:\Users\Andreea\AppData\Local\Temp\arduino_build_493197/Rgb_led.ino.bin
esptool v0.4.13 - (c) 2014 Ch. Klippel ck@atelier-klippel.de
setting board to nodemcu
setting baudrate from 115200 to 921600
An error occurred while uploading the sketch
setting port from COM1 to COM1
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
error: Failed to open COM1
error: espcomm_open failed
error: espcomm_upload_mem failed

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Make sure you have selected the port of your Arduino board from the Tools > Port menu.

You can find the port like this:

  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.