The TRAPPIST-1 system is remarkable for its seven planets that are similar in size, mass, density and stellar heating to the rocky planets Venus, Earth and Mars in the Solar System1. All the TRAPPIST-1 planets have been observed with transmission spectroscopy using the Hubble or Spitzer space telescopes, but no atmospheric features have been detected or strongly constrained2-5. TRAPPIST-1 b is the closest planet to the M-dwarf star of the system, and it receives four times as much radiation as Earth receives from the Sun. This relatively large amount of stellar heating suggests that its thermal emission may be measurable. Here we present photometric secondary eclipse observations of the Earth-sized exoplanet TRAPPIST-1 b using the F1500W filter of the mid-infrared instrument on the James Webb Space Telescope (JWST). We detect the secondary eclipses in five separate observations with 8.7σ confidence when all data are combined. These measurements are most consistent with re-radiation of the incident flux of the TRAPPIST-1 star from only the dayside hemisphere of the planet. The most straightforward interpretation is that there is little or no planetary atmosphere redistributing radiation from the host star and also no detectable atmospheric absorption of carbon dioxide (CO2) or other species.