在node中,有全局變量process表示的是當(dāng)前的node進(jìn)程。process.env包含著關(guān)于系統(tǒng)環(huán)境的信息。但是process.env中并不存在NODE_ENV這個(gè)東西。NODE_ENV是用戶一個(gè)自定義的變量,在webpack中它的用途是判斷生產(chǎn)環(huán)境或開發(fā)環(huán)境的依據(jù)的。
創(chuàng)新互聯(lián)公司專注于南昌縣網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供南昌縣營銷型網(wǎng)站建設(shè),南昌縣網(wǎng)站制作、南昌縣網(wǎng)頁設(shè)計(jì)、南昌縣網(wǎng)站官網(wǎng)定制、小程序定制開發(fā)服務(wù),打造南昌縣網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供南昌縣網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。為了查看 process的基本信息,我們可以在文件夾中 新建一個(gè) process.js 文件,在里面加一句代碼:console.log(process);然后進(jìn)入該文件夾,執(zhí)行 node process.js 可以在命令行中打印如下信息:
$ node process.js process { title: 'node', version: 'v4.4.4', moduleLoadList: [....], versions: { http_parser: '2.5.2', node: '4.4.4', v8: '4.5.103.35', uv: '1.8.0', zlib: '1.2.8', ares: '1.10.1-DEV', icu: '56.1', modules: '46', openssl: '1.0.2h' }, arch: 'x64', platform: 'darwin', release: { name: 'node', lts: 'Argon', sourceUrl: 'https://nodejs.org/download/release/v4.4.4/node-v4.4.4.tar.gz', headersUrl: 'https://nodejs.org/download/release/v4.4.4/node-v4.4.4-headers.tar.gz' }, argv: [ '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin/node', '/Users/tugenhua/個(gè)人demo/process.js' ], execArgv: [], env: { TERM_PROGRAM: 'Apple_Terminal', SHELL: '/bin/zsh', TERM: 'xterm-256color', TMPDIR: '/var/folders/l7/zndlx1qs05v29pjhvkgpmhjm0000gn/T/', Apple_PubSub_Socket_Render: '/private/tmp/com.apple.launchd.7Ax4C1EWMx/Render', TERM_PROGRAM_VERSION: '404', TERM_SESSION_ID: '82E05668-442D-4180-ADA3-8CF64D85E5A9', USER: 'tugenhua', SSH_AUTH_SOCK: '/private/tmp/com.apple.launchd.MYOMheYcL3/Listeners', PATH: '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin', PWD: '/Users/tugenhua/個(gè)人demo', LANG: 'zh_CN.UTF-8', XPC_FLAGS: '0x0', XPC_SERVICE_NAME: '0', SHLVL: '1', HOME: '/Users/tugenhua', LOGNAME: 'tugenhua', SECURITYSESSIONID: '186a8', OLDPWD: '/Users/tugenhua/工作文檔/sns_pc', ZSH: '/Users/tugenhua/.oh-my-zsh', PAGER: 'less', LESS: '-R', LC_CTYPE: 'zh_CN.UTF-8', LSCOLORS: 'Gxfxcxdxbxegedabagacad', NVM_DIR: '/Users/tugenhua/.nvm', NVM_NODEJS_ORG_MIRROR: 'https://nodejs.org/dist', NVM_IOJS_ORG_MIRROR: 'https://iojs.org/dist', NVM_RC_VERSION: '', MANPATH: '/Users/tugenhua/.nvm/versions/node/v4.4.4/share/man:/usr/local/share/man:/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man', NVM_PATH: '/Users/tugenhua/.nvm/versions/node/v4.4.4/lib/node', NVM_BIN: '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin', _: '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin/node', __CF_USER_TEXT_ENCODING: '0x1F5:0x19:0x34' }, pid: 14034, features: { debug: false, uv: true, ipv6: true, tls_npn: true, tls_sni: true, tls_ocsp: true, tls: true }, _needImmediateCallback: false, config: {}, nextTick: [Function: nextTick], _tickCallback: [Function: _tickCallback], _tickDomainCallback: [Function: _tickDomainCallback], stdout: [Getter], stderr: [Getter], stdin: [Getter], openStdin: [Function], exit: [Function], kill: [Function], mainModule: Module { id: '.', exports: {}, parent: null, filename: '/Users/tugenhua/個(gè)人demo/process.js', loaded: false, children: [], paths: [ '/Users/tugenhua/個(gè)人demo/node_modules', '/Users/tugenhua/node_modules', '/Users/node_modules', '/node_modules' ] } }
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。