Knitting lines can be prevented by selecting the right material, paying careful attention to the design, using higher temperatures, and monitoring injection speed and pressure.