I understand that the idea behind a virtual environment is to give your project's dependencies a local installation as opposed to a global one. I followed the steps to successfuly create and activate a virtual environment for node using nodeenv
. However, I'm curious as to where to place this folder relative to my project folder. For this example, I am using a Github repo. Does the env
folder go inside my project folder? Or should I create the env
folder and then install the Github repo inside of it?
What I did:
- Installed Node.js on my machine
npx express-generator-typescript --with-auth MyProject
- Installed python 3x
pip install nodeenv
cd C:\MyProjectDir
nodeenv env
.env/bin/activate
Doing the steps above created the env
folder inside of my main project folder.
Update: I see that someone voted to close this question because they thought it was opinion-based. This was not my intention, but I guess I worded it strangely. I am looking for the correct way to install a virtual environment.
2nd update: Not sure why this was closed due to not being focused. I'm only asking 1 thing - where does the nodeenv
folder need to be placed relative to the main project directory? Can someone please explain why they thought the question was unfocused?