  In this paper, we explore possibilities of resolving the Hubble tension and
$(g-2)_{\mu}$ anomaly simultaneously in a $L_\mu-L_\tau$ model with Majoron. We
only focus on a case where the Majoron $\phi$ does not exist at the beginning
of the universe and is created by neutrino inverse decay $\nu\nu\to \phi$ after
electron-positron annihilation. In this case, contributions of the new gauge
boson $Z'$ and Majoron $\phi$ to the effective number of neutrino species
$N_{\rm eff}$ can be calculated in separate periods. These contribution are
labelled $N'_{\rm eff}$ for the $L_\mu-L_\tau$ gauge boson and $\Delta N_{\rm
eff}$ for the Majoron. The effective number $N_{\rm eff} = N'_{\rm eff} +
\Delta N_{\rm eff}$ is evaluated by the evolution equations of the temperatures
and the chemical potentials of light particles in each period.
  As a result, we found that the heavier $Z'$ mass $m_{Z^\prime}$ results in
the smaller $N_{\mathrm{eff}}^\prime$ and requires the larger $\Delta
N_{\mathrm{eff}}^\prime$ to resolve the Hubbel tension. Therefore, compared to
previous studies, the parameter region where the Hubble tension can be resolved
must be slightly shifted toward the larger value of $m_{Z^\prime}$.
