Pure nitrogen gas target and a 10 TW laser were used to accelerate electrons by a laser wakefield acceleration. A well collimated with stable pointing electron beam was generated. When the density was 9.4 × 1018 cm−3, electron beams with divergences 5.2 ± 1.2 mrad in horizontal and 4.2 ± 0.8 mrad in the vertical directions were generated. The electron peak energy was 117 ± 12 MeV which is close to the expected value by the scaling formula. The tendency of the maximum energy and energy distribution changes with different density shows that electrons were accelerated to dephasing length with high density and acceleration distance was less than the dephasing length with low density. From this, it seems that the length of the plasma for deformation of the laser is required for the ionization injection, and the plasma length should be longer than the dephasing length.