Can't upload sketch to esp8266

I'm having issues with uploading a sketch on my esp8266 from nodemcu. Anytime I try i get this error message;

Arduino: 1.8.1 (Linux), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

Build options changed, rebuilding all
Sketch uses 225837 bytes (52%) of program storage space. Maximum is 434160 bytes.
Global variables use 31788 bytes (38%) of dynamic memory, leaving 50132 bytes for local variables. Maximum is 81920 bytes.
error: cannot access /dev/ttyUSB0

error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

I've been able to solve the first error but can't seem to figure out what's causing the other errors. Any help will be greatly appreciated.

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. Using code tags and other important information is explained in the How to use this forum post. Please read it.

Select the correct port from the Tools > Port menu. If that menu is grayed out or the port of your nodemcu doesn’t appear you may have a defective or charging only USB cable so try another one or verify yours works on a different device.

I’ve been able to solve the first error

Which one specifically?

can’t seem to figure out what’s causing the other errors.

Always post your most recent error messages. It’s not helpful to post outdated error messages.

Thank you all for your suggestions and help. I’ve been able to solve the issue. All I had to do was type
sudo usermod -a -G dialout <username>
Since I’m using a Linux system so I can have access to the serial port. The trick was to reboot my system after doing that.