[#4978] Restrict node compilations to match environment
[#4978] Fix bug where syntax changes in all environments checked instead of specific env