Can NM cable be installed in a junction box mounted to a floor joist in an unfinished area?
You can definitely use joists to support light and switch boxes. You just need to think it out and know what type of fixture is going up there. Recessed lighting needs a little more planning as they are usually installed between joists. Happy wiring.