$ setx NODE_TLS_REJECT_UNAUTHORIZED 0
SUCCESS: Specified value was saved.
$ node -e "console.log(process.env.NODE_TLS_REJECT_UNAUTHORIZED); console.dir(process.env.windir);"
undefined
'C:\\WINDOWS'
setx
说它有效(价值被“保存”)。但是节点process.env对象不包含它。为什么setx
错了?
这也不起作用:
$ set NODE_TLS_REJECT_UNAUTHORIZED=0
$ node -e "console.log(process.env.NODE_TLS_REJECT_UNAUTHORIZED)"
undefined
顺便说一下,它确实可以使用此命令:$env:NODE_TLS_REJECT_UNAUTHORIZED="0"