Floobits / atom-term3

Open Terminal tabs in Atom. Fork of Term package
Other
88 stars 17 forks source link

NODE_ENV is set to production default #39

Open Fonger opened 8 years ago

Fonger commented 8 years ago

I found the following in printenv in atom-term3 shell.

NODE_PATH=/Applications/Atom.app/Contents/Resources/app.asar/exports
NODE_ENV=production

This may be caused by ATOM because it's written in node itself. I am using npm config to run node app in this shell and found that it always run in production mode.

ericclemmons commented 8 years ago

I just stumbled upon the same. I'm not sure what the correct course of action is.

ggreer commented 8 years ago

On startup, Atom checks if NODE_ENV is set. If not, it sets it to "production". They do this to improve React's performance and avoid errors related to React running in debug mode. See https://github.com/atom/atom/blob/82fa61e54d88799788ab4125dd8152974d8496c3/src/initialize-application-window.coffee#L20 for the exact code responsible for this.

If you want to run node stuff in debug mode, you'll have to add export NODE_ENV=development to the relevant bash/zsh/etc-rc.