Uploading to NodeMCU fails, Nano and ESP32 ok

Hi @reinierdevlaam. One of the possible causes of this error is the port being open in another application. Only one application can have a serial port open at a time so Arduino IDE can't perform an upload under these conditions.

Check to see whether you have any applications running on your computer that might use the port. If they are, close them and then try the upload again.