Environmental variable working inconsistently when doing different builds

I have code in my mobile-config.js that changes the app name based on this.process.env.DEPLOY_TYPE

I have a staging version which I build like this DEPLOY_TYPE="staging" meteor build ./.meteor/local/build/ios-staging --server="https://staging.qidza.com" --mobile-settings="./deployment/staging/settings.json" and a production version which I build like this DEPLOY_TYPE="prod" meteor build ./.meteor/local/build/ios-prod --server="https://app.qidza.com" --mobile-settings="./deployment/prod/settings.json"

What’s strange is sometimes the build has the changes according to the right DEPLOY_TYPE condition and sometimes it doesn’t. It’s seemingly inconsistent and without a pattern. Is there some sort of caching that meteor does? Am I setting the env variable incorrectly?

I guess it’s actually related to this https://github.com/npm/npm/issues/12607 I think this is a npm issue so I’ll close the issue on this forum but if anyone has any ideas let me know

Just curious - why this.process.env.DEPLOY_TYPE and not process.env.DEPLOY_TYPE?