Failed uploading: no upload port provided

I am getting this message while i connect and trying compliling via IDE.

WARNING: library LiquidCrystal_I2C claims to run on all architecture(s) and may be incompatible with your current board which runs on avr architecture(s). Sketch uses 6528 bytes (20%) of program storage space. Maximum is 32256 bytes. Global variables use 517 bytes (25%) of dynamic memory, leaving 1531 bytes for local variables. Maximum is 2048 bytes.
Failed uploading: no upload port provided

What could be the root cause? How to sort this out?

HI @noufal986. This error occurs if you attempt to perform an upload when you don't have anything selected from Arduino IDE"s Tools > Port menu.

Select the port of your Arduino board from the Tools > Port menu and then try uploading again. Hopefully this time everything will work as expected.

If the Tools > Port menu is disabled, or if you don't see the port of the Arduino board listed in that menu, just add a reply here on this forum topic to let us know and we'll provide further assistance.

Yes , port is disabled. But i can able to see the board name listed.

Fyr,
Arduino UNO
Installed driver: CH340
Windows 11

also in my Uno board i am seeing Mega16U2 on the chip.

That's the ATmega16U2 responsible for communication with the computer.

That's the wrong driver for the 16U2. When you installed the IDE it should have installed the driver for the 16U2.

You'll have to look in Windows device manager if the board is correctly identified under Ports (COM & LPT). With the 16U2 this would be for the Uno

I've listed a few apps on this page that you may find useful in identifying the problem.