LeBron James scored a game-high 31 points as the Los Angeles Lakers cruised to a 117-87 win over the New York Knicks.