write environment during npm to a file