Whenever wires are spliced together in a circuit whether it s to hook up a switch or light fixture or simply to extend the length of a wire the splice connections must be inside a covered junction box.
Light fixtures that do not require junction box.
Many local building codes require metal junction boxes because they are durable and ensure long lasting performance.
The boxes made without metal are pvc or plastic.
For example if you have a light fixture that doesn t need a box for mounting but the wiring connections are not protected by some kind of cover then you can t use the fixture without a junction box.
Light fixture wiring if the new light fixture has the wire leads hanging out of the housing and there is no provision for internally containing and.
It ll stick out slightly but it beats sparky splices lighting your studs up.
Scott if the new exterior light fixture has a built in junction box or an enclosure where the wiring connections can be made and protected then you would not need to install a junction box.
Surface mounted boxes are your friend here.
Metal boxes are usually made of aluminum steel or cast iron.
Choose from many junction box sizes to find the one that best suits your project.
How to center a light fixture when the junction box is off center.
What i d do in this admittedly awkward scenario is use a surface mounted pancake box screwed to the stud through the drywall and feed the cable into that through a cableclamp and back of box ko then mount the fixture to the pancake box.