The present disclosure provides a new method for preparing IDO inhibitor epacadostat. The whole reaction route is simple, easy to control and has high yield.