The following words, however clear they might be in an English translation like the TNIV, are much disputed:
Or do you think Scripture says without reason that the spirit he caused
to live in us envies intensely? But he gives us more grace. That is why
Scripture says:
“God opposes the proud
but gives grace to the humble.”
I clip this from my forthcoming commentary on James, which sums up a lengthy discussion:
“If we put this together, then, we have this: the subject of the verb is most likely “the spirit”; that word most likely refers to human spirit given by God to use to be used for God’s glory. Therefore, we have a sentence that literally reads like this so far: “the spirit that God caused to dwell in us yearns toward jealousy.” Now we can be more specific: the leaders were using God’s bestowal of the spirit – not for God’s glory – but for their own glory; they were letting the spirit of envy rule their hearts.”
And this whole jealousy thing: “The distinctive and decisive problems with the divine jealousy reading of 4:5 are two: first, though it is possible that James simply alludes to a text when he says “scripture” in verse five, the evidence uniformly supports the view that James means a specific text in Scripture. This is simply not the case with the view that James is alluding to the theme of divine jealousy. The word “scripture” leads us to look for a cited text and we find that, albeit delayed for the moment, in 4:6. (We argue below that 4:5b-6a is a paraphrase of the text cited in 4:6b.)
Second, and in our view decisive, is that the expression “yearns with jealousy” uses a term, the Greek word phthonos, that is uniformly negative and never used of God. it is nearly impossible to think of God yearning “with jealousy” (pros phthonon). Furthermore, the expression itself fits admirably with the theme of human envy on the part of the teachers in 3:13-18 and 4:1-3. Thus, the scripture reference to which James refers is found in James 4:6 (Prov 3:34) and the point James makes before he gets to that citation is what is needed for James to get to that point: the teachers have within them a divinely-planted spirit that (un)naturally craves for envy and the good news is that God is there to supplant those cravings with his grace.