A compressor where welding between a casing and an inner component or welding between a barrel casing and an end casing has sufficient strength and the welding has low strain achieved by suppressing an influence of heat by welding. A method of producing the compressor (1, 101) has a positioning process and a welding process. The compressor has the casing (10, 11, 111) and the inner component (60, 125) received in the casing. The casing has at its inner surface (11s, 111s) a first section (11a, 11w, 111w), and the inner component has a second section (60a, 61, 125b). The second section faces the first section. The first section and the second section are made to face each other in the positioning process. In the laser welding process, a laser beam is applied to at least a portion of the part where the first section and the second section are faced each other to laser-weld the casing and the inner component together.