0% found this document useful (0 votes)
66 views1 page

Setting Up Environment Variables Linux/Mac Os

Environment variables are added to the ~/.bash_profile file on Linux/Mac OS and can be edited using vim. Variables are exported using the export keyword and accessed in a project using process.env. On Windows, environment variables are configured through the system properties by clicking new under system variables to set the name and value.

Uploaded by

Sandeep Dwivedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views1 page

Setting Up Environment Variables Linux/Mac Os

Environment variables are added to the ~/.bash_profile file on Linux/Mac OS and can be edited using vim. Variables are exported using the export keyword and accessed in a project using process.env. On Windows, environment variables are configured through the system properties by clicking new under system variables to set the name and value.

Uploaded by

Sandeep Dwivedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Setting up Environment Variables Linux/Mac Os

Environment variables are added to the ‘.bash_profile’ directory,


for the current user.
We will be using vim editor for viewing and editing environment
variables (You can use any other editor if you like).
1. Open a new terminal

2. Type vi ~/.bash_profile

3. Now you can add desired environment variable by using the export
keyword. For e.g.
export USER_EMAIL="user@codingninjas.in"
export USER_PASSWORD="coding"

4. Now to save the bash_profile press Esc followed by ‘:wq’ (write


and quit)

5. Now These can now be used in the project using


userEmail = process.env.USER_EMAIL
userPassword = process.env.USER_PASSWORD

Setting up Environment Variables Windows

1. To add environment variables in windows, go to start, search


environment variables

2. Now under system variables click on new

3. Now set the variable name what you require and also set the
values.For example set variable name as port and value as 8000

4. For using the environment variable in the project use


process.env.Variable_name (e.g. process.env.port )

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy