This is a question that has been asked if all model pathfinders. For the most part, it is probably easier to just go out and buy/trade for a 4wd version. That's not the answer most want to hear, but when it comes down to keeping things factory, the cost can get kinda high. Some have done it and I'm not telling you your shouldn't, but it's your money and time.
For the most part, you will probably need a transmission and transfer case. The wiring should be there fo the transfer case, but it may be different. You will probably need different contort units as they need to talk to each other to know what systems on on the vehicle. This may include the ECM, ABS/VDC module, trans control unit(inside transmission) and possibly some others. Then you run into a few sensor issues as your adding a front differential. The transfer case engaging switch in the dash and associated parts. You would have to double check to make sure the gears in the rear match(which may have to be swapped also). The list could get bigger as you put things together.
Now, if you were going custom, that's a whole different ball of wax. You could find different axles and fab stuff up(if you have those skills) to save money. I think there is a SAS's r51 out there somewhere, but your going to have to dig to find it.
A lot of people try something this ambitious at tie s and then give up on it. Then the rig sits for years and eventually is given up on, sold or sent to the scrap yard. This is just my 2 cents. Maybe someone else will ring in with another opinion.