The ARGO-YBJ detector, located at high altitude in the Cosmic Ray Observatory of Yangbajing in Tibet (4300 m asl, about 600 g/cm2 of atmospheric depth) provides the opportunity to study, with unprecedented resolution, the cosmic ray physics in the primary energy region between 10^{12} and 10^{16} eV. The preliminary results of the measurement of all-particle and light-component (i.e. protons and helium) energy spectra between approximately 5 TeV and 5 PeV are reported and discussed. The study of such energy region is particularly interesting because not only it allows a better understanding of the so called knee of the energy spectrum and of its origin, but also provides a powerful cross-check among very different experimental techniques. The comparison between direct measurements by balloons/satellites and the results by surface detectors, implying the knowledge of shower development in the atmosphere, also allows to test the hadronic interaction models currently used for understanding particle and cosmic ray physics up the highest energies.