Next.js Discord

Discord Forum

Next.js staring in developmetd mode in production

Answered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
cat .env | grep NODE_ENV
NODE_ENV="production"


But in my next.config.js when I console.log(process.env.NODE_ENV) it shows "development". Wtf?

No other .env files
Answered by Northeast Congo Lion
I think this may be because I'm running next instead of next start
View full answer

3 Replies

Northeast Congo LionOP
I'm running with pm2, startup command is node /var/www/site/node_modules/.bin/next
Northeast Congo LionOP
I think this may be because I'm running next instead of next start
Answer
@Northeast Congo Lion I think this may be because I'm running `next` instead of `next start`
correct. next = next dev which sets environment to development