1

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:

  1. Installed Node.js on my machine
  2. npx express-generator-typescript --with-auth MyProject
  3. Installed python 3x
  4. pip install nodeenv
  5. cd C:\MyProjectDir
  6. nodeenv env
  7. .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?

TheMortiestMorty
  • 421
  • 2
  • 4
  • 12
  • 1
    I am not sure why it was closed. Sometimes it appears people vote that way once they a vote. I am voting to reopen. – Rohit Gupta Aug 13 '23 at 03:31

0 Answers0