I have a 2001 Nissan frontier and the air hasn’t been working for a while now. So I need to know how many cans of freon does it need?

First you need to find the leak.
A/C is a sealed system…needing freon is not as simple as that.
Could be as simple as a dollar o-ring…or not.
If you buy some leak detecting R134…the truck takes 23 oz of refrigerant.

Thanks @“ken green” , but I have another question. What should I do about the air compressor, it continues to turn off and on

This is one of those ‘if you have to ask’ questions. Take to a pro, they’ll be able to fix it correctly.

Thanks @texases

I agree with texases. If you don’t have the proper equipment (gauges) and expertise, you shouldn’t mess with an A/C system. You could easily end up with a damaged system and in the worst case you could even end up blinding yourself.

“What should I do about the air compressor, it continues to turn off and on”

Most likely, it’s short cycling, because you’re low on r134a

Pay for a shop to do a recover, evacuate and recharge. The problem might be very obvious to them, such as a visibly green ac compressor or condenser, or manifold hose.

Have the shop add ultraviolet dye. This is sucked in through the low side, with the engine idling and the ac compressor engaged

Then they look for the leak with yellow glasses and a black light. The leak may show up very quickly, or it may not be visibly for months