According to God's New Testament dispensation, the believers are not under the law but under grace (Rom. 6:14). The law was the way God dealt with His Old Testament saints, and grace is the new way in which God deals with His New Testament saints. Thus, we, the New Testament people, are not under the law anymore; we are under grace.
In the New Testament economy, the believers have been freed by Christ from the law's yoke of slavery, no longer indebted to the law; if they will still keep the law, Christ will profit them nothing, they will be separated from Christ, and they will fall from grace (Gal. 5:1-4). The law is not to release people but to yoke them, and that yoke is the yoke of slavery. The law puts us into a situation of slavery, which Paul said is the yoke of the law.
Hence, Paul said that the believers have died to law (Gal. 2:19). We were crucified with Christ on the cross (v. 20) and died to law there. James taught the believers, who were dead to the law, to keep the law.
Now we want to point out the side effects of James's teaching.
First, it is a mixture of God's New Testament dispensation with God's Old Testament dispensation.
It uses the terms of the Old Testament Jews, such as "the twelve tribes," "synagogue," and "the Lord of hosts [Jehovah of hosts]" in 1:1; 2:2; 5:4.
In 1:27 James said to take care of the orphans and widows, and in 4:14 he said not to have confidence in what we will do in the future, since we are a vapor and do not know what the future will bring. This is an idea of the Old Testament, especially in Psalm 90 where Moses spoke of the brevity of human life (vv. 3-10).