First of all, if there were no dark matter (DM), you wouldn't ask this question, since structures — including galaxies, stars, planets, and you — wouldn't have had the time to form in the early Universe before it had expanded too much for gravitational collapse to occur. But let's use magic and make the galaxies anyway:
The CMB (specifically the power spectrum of the CMB) shows that the total density $\rho_\mathrm{tot}$ of mass/energy in the Universe is extremely close to the critical density $\rho_\mathrm{c}$. That is, $$ \frac{\rho_\mathrm{tot}}{\rho_\mathrm{c}} \equiv \Omega_\mathrm{tot} \simeq 1. $$ The "$\Omega$" is a common way to express densities; as a ratio to the critical density. The CMB also gives some constraints on the total amount of mass (DM + "normal" matter, i.e. baryons), but it is better at constraining the ratio of baryons-to-DM. Together with the matter density $\Omega_\mathrm{M}=\Omega_\mathrm{b}+\Omega_\mathrm{DM}$ obtained from observations of supernovae and, in particular, baryonic acoustic oscillations, we then obtain the amount of DM. This fraction is roughly $\Omega_\mathrm{DM}=0.26$ (Planck Collaboration et al. 2016). If there were no DM, then $\Omega_\mathrm{tot}$ just wouldn't be $1$, but rather $\Omega_\mathrm{tot} - \Omega_\mathrm{DM} \simeq 0.74$.
Similarly, if there were no DM, there would be less matter to counteract the expansion of the Universe. That means that we wouldn't observe the same relation between the brightness and the distance of supernovae, from which we infer the presence of dark energy (DE). Instead, the brightnesses would be somewhat lower, because the supernovae would be farther away due to the faster expansion.
In other words, you are right that if there were no DM, and if we observed the same thing as we do, then there would be a contradiction. But if there were no DM, we wouldn't see what we see. Therein lies the resolution.