Please post your sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination
Sounds to me like the error is nothing to do with your NodeMCU or your code.
Have you tried uploading the blink sketch to the NodeMCU? I expect you will get the same error.
Can you upload the blink sketch to another type of Arduino, like a Uno/Nano?
If you can't upload blink sketch to the NodeMCU but you can upload it to other Arduino, I think the problem could be the installation of your ESP8266 boards package. Maybe try uninstalling and reinstalling that.
UNO has NO WiFi, ESP8266 does. You don't need the UNO.
Your error is a permissions error, nothing to do with programming an esp8266 or UNO.
What platform are you using, Win, Mac, Unix?
Please try to be less terse and ambiguous in your replies. Do you mean you got the same error uploading the blink sketch to the ESP8266 or uploading blink sketch to the Uno?
If you meant the ESP failed to upload with same error, were you able to upload blink sketch to Uno or did that also give an error?
But we don't know if that is what @robotmaker6000 has because they have been stingy with important details. Hopefully @robotmaker6000's next post will give more details and the forum will be able to help.
All true, and does anyone see a need for two boards, either he has failed to tell us important facts or he is missing important concepts of how to do what he wants.