In this research we use a generalized hydrodynamic model to numerically investigate the quasi-neutral expansion and compression of an electron–ion plasma with nonextensive electron velocity distribution into or from vacuum. We study the effects of kinematic viscosity and electron–ion collisions on the expansion profile and compare our results to the numerical solutions of the standard Korteweg – de Vries (KdV) equation. It is found that the quasi-neutrality assumption in the hydrodynamic approach in the absence of viscosity and collisions, which leads to elimination of Poisson’s equation, sets the weak dispersion limit and becomes equivalent to the standard weakly dispersive KdV model. In the weak dispersion limit our model, as well as the KdV with small dispersion effect, predicts that a pulse-like initial profile evolves into solitary wave train. We further show that in a plasma expansion different shock profiles, such as purely dispersive, diffusive–dispersive, and dissipative ones, with significantly different characters may form. Finally, the effect of electron nonextensivity on oscillatory shock waves shows that the expansion profile is affected by changes of q-parameter. Our numerical solution is in qualitative agreement with some distinguished experiments showing the possibility of dispersive shock wave formation in rarefied plasma during an expansion into vacuum.