Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于环境变量的理解 #32

Open
yuandaishi opened this issue Mar 1, 2020 · 0 comments
Open

关于环境变量的理解 #32

yuandaishi opened this issue Mar 1, 2020 · 0 comments
Labels
node something about node

Comments

@yuandaishi
Copy link
Owner

首先,对于windows操作系统,我们可以通过set命令修改某个环境变量的值。
set
获取某一个环境变量的值:set 环境变量名称
设置某个环境变量的值:set 环境变量名=值

说明:
1.如果控制面板->高级系统设置中环境变量有对应的环境变量,那么,我们可以通过set命令获取到该环境变量的值,否则返回undefined。

2.set命令并不会修改控制面板->高级系统设置中环境变量的值,也就是说重启cmd之后,通过set命令获取的环境变量的值会重置为控制面板->高级系统设置中环境变量的值。

3.每个CMD窗口设置环境变量的时候,是互不干扰的,例如a cmd窗口设置环境变量name='yuands',并不会影响到b cmd窗口的环境变量name的值。

4.每次打包build或者dev的时候,会设置相应的环境变量。代码逻辑会根据获取到的环境变量进行不同的逻辑处理。

@yuandaishi yuandaishi added the node something about node label Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node something about node
Projects
None yet
Development

No branches or pull requests

1 participant