The debris disk surrounding $beta$ Pictoris has a gas composition rich in carbon and oxygen, relative to solar abundances. Two possible scenarios have been proposed to explain this enrichment. The preferential production scenario suggests that the gas produced may be naturally rich in C and O, while the alternative preferential depletion scenario states that the enrichment has evolved to the current state from a gas with solar-like abundances. In the latter case, the radiation pressure from the star expels the gas outwards, leaving behind species less sensitive to stellar radiation such as C and O. Nitrogen is also not sensitive to radiation pressure due to its low oscillator strength, which would make it also overabundant under the preferential depletion scenario. As such, the abundance of N in the disk may provide clues to why C and O are overabundant. We aim to measure the N column density in the direction of $beta$ Pic, and use this information to disentangle these different scenarios explaining the C and O overabundance. Using far-UV spectroscopic data collected by the HSTs Cosmic Origins Spectrograph (COS) instrument, we analyse the spectrum and characterise the NI triplet by modelling the absorption lines. We measure the N column density in the direction of $beta$ Pic for the first time, and find it to be $log(N_{mathrm{NI}}/1,mathrm{cm}^2) = 14.9pm0.7$. The N gas is found to be consistent with solar abundances and Halley dust. The solar N abundance supports the preferential production hypothesis, in which the composition of gas in $beta$,Pic is the result of photodesorption from icy grains rich in C and O or collisional vaporisation of C and O rich dust in the disk. It does not support the hypothesis that C and O are overabundant due to the insensitivity of C and O to radiation pressure thereby leaving them to accumulate in the disk.