How to setup Virtual environment for multiple NodeJS & Python projects using Anaconda.

Sumit Ojha
Nov 5 · 2 min read

At times handling multiple projects Simultaneously require multiple versions of different Packages and at those times using multiple Virtual environment is the best solution.

In this blog I am going to show you how to install nodejs in anaconda and create an Angular7 project using NPM.

What is Anaconda ?

Anaconda Navigator is a desktop graphical user interface (GUI) included in Anaconda® distribution that allows you to launch applications and easily manage conda packages, environments, and channels without using command-line commands and it is mostly used for python projects.

You can download it here.

After installing Anaconda

Follow this simple steps to run your angular project in anaconda.

[STEP 1] Open Anaconda Prompt in your PC and create new environment named “test_envir” using the below code (I am going to use python 3.3, you can use any python version).

conda create -n test_envir python=3.3 anaconda

[STEP 2] Set the PATH in Environment Variable as:

set PATH=C:\Anaconda\envs\ test_envir \Scripts;C:\Anaconda\envs\ test_envir;%PATH%

[STEP 3] Now switch to the current newly created Virual envronment.

activate test_envir

The line above is the Windows equivalent to the code that normally appears in the tutorials for Mac and Linux:

$ source activate test_envir

[STEP 4] Once you have activated the new environment you can install node JS inside it using

conda install -c conda-forge nodejs

[STEP 5] Install an angular-cli specific version

npm install -g @angular/cli@wished.version.here

In my case I used the below code to install Angular 7

npm install -g @angular/cli@7.3.2

[STEP 6] Now that we have the file structure for our project, let us compile our project with the following command −

ng serve

Now Go to browser and type http://localhost:4200/

Conclusion

Following the above 6 steps you can create as many virtual environment for Node and python based projects and just by activating the environment you can toggle between those projects.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade