Lemme channel an RCC poster.
BUT WHAT ABOUT JAMES YOU PROT HERETIC.
Answer: Different person, different purpose, different audience. Always study Scripture IN context. And James was writing to a church that had erred on the side of libertine.
An analogy is that Paul and James are not fighting face-to-face against each other, but are fighting back-to-back together against two separate groups: the legalists and the libertines.