zhihuilai
zhihuilai
Hi, Jed. In windows, `set NODE_ENV=production` is ok, but `NODE_ENV=production` will throw an error, I found a node package `cross-env`, it can help to set environment variables cross platform. [https://github.com/kentcdodds/cross-env](https://github.com/kentcdodds/cross-env)
test js: ```javascript var detectNode = require('detect-node'); console.log('detectNode: ', detectNode, typeof global, typeof process, typeof process.env, process.env.NODE_ENV, Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0)); ``` reuslt: > detectNode: false...
嘿嘿,给你修改了一下颜色
Hi Jed :) , in windows, use `npm` will throw an error, consider using `npm.cmd`, it works fine.