cannot upload sweep

I just bought a board and when I connected the SG90 servo and tried 'sweep',, it says
'Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.'
It worked just fine when I tried 'Blink' ,though. I don't think the wire is incorrectly connected but this is the picture of it. Am I doing anything wrong here?

(deleted)

Please provide your sketch inside code tags ( </> )

Did you try to upload without the servo connected ?

When you sent BLINK up to the board did you change a value so that you knew it was your copy of BLINK and not the built in version ?

The wiring looks correct but it missed out the servo itself as some servos have different connections.

Thank you very much! It can be uploaded when nothing is connected to the board.

But with the servo, it didn't worked and the message was:
Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 2160 bytes (6%) of program storage space. Maximum is 32256 bytes.
Global variables use 52 bytes (2%) of dynamic memory, leaving 1996 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\.\COM4": The system cannot find the file specified.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

The other time I didn't directly connected the servo to the board and the message was:
Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 2160 bytes (6%) of program storage space. Maximum is 32256 bytes.
Global variables use 52 bytes (2%) of dynamic memory, leaving 1996 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\.\COM4": The system cannot find the file specified.

An error occurred while uploading the sketch

I used the example sketch for 'sweep', But I changed the value in 'Blink' and it blinked differently. I also checked the color of my servo's wire and it doesn't seems to be any problem.
If nothing should be connected to the board while uploading, I should upload the sketch first and then plug in all the wire later?

Sorry for so many question. I'm really new to this. Thank you so much for the answers.

It might be worth making sure you are using a USB 2.0 port and not a USB 3.0 port as they can on occasion cause random upload issues.

If it uploads just fine without the servo connected then it would indicate an issue with the servo and or wiring and not the Arduino.

Some of us often disconnect things prior to send a sketch up and then re-connect later (with the board powered down).

Thank you soooo much. It can be uploaded now after switching to USB 2.0 port. Nothing happen even after the sketch has been uploaded,though. But I guess that is the problem with the servo itself.