npx cross-env NODE_ENV=production node server.js

Category: Node.js & npm/yarn

npx cross-env NODE_ENV=production node server.js

Set environment variables cross-platform before running a command — needed on Windows

Sets environment variables before running a command in a way that works on Windows, Mac, and Linux — Windows uses different syntax (set instead of export).
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.