Check node environment by window instead of module.