NodeJS | Setup environments

Working with multiple NodeJS Versions

If you plan to work with different NodeJS Version, we suggest to setup the following folder structure. Choose for #YOUR ROOT# whatever you want as your base folder, e.g. D:\Development

Install NodeJs Binary Package (.zip File)

Download and extract the NodeJS Binary Package to your destination folder:

Version32 Bit64 Bit

So, NodeJS 15.2.1 Files should be extracted to:

 #YOUR ROOT#\Environments\NodeJS\15.2.1\node

Kepp in mind: if you extract the zip file. it creates a folder with the name of the zipfile and extracts all files in this folder, e.g. node-v15.2.1-win-x86.

We wil call this installation folder HOME_NODE.

HOME_NODE = "D:\Development\Environments\NodeJS\15.2.1"

So, best practice is to extract the zip file in the NodeJS folder #YOUR ROOT#\Environments\NodeJS\15.2.1 ($HOME_NODE) and rename node-v15.2.1-win-x86 to node after extraction is complete.

Your finale folder structure should look like this:

Create start script

Create a start script to setup up environment variables and path:


$NODE_VERSION              = "15.2.1"
$ENV:NODE_HOME             = "D:\Development\Environments\NodeJS\$NODE_VERSION"

$ENV:NPM_CONFIG_REGISTRY   = "http://localhost:4873"


Write-Host "╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
Write-Host "║                                       N O D E J S  ---  P L A Y G R O U N D                                          ║"
Write-Host "╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝"

npm config set registry "$ENV:NPM_CONFIG_REGISTRY"

echo "HOME_NODE           = $ENV:NODE_HOME"
echo "NODE                = $((Get-Command node.exe).Path)"

Create a Shortcut

Create a Shortcut for this file by dragging the powershell script (with pressed ALT key).

Rename the Shortcut, e.g. “Start NodeJS 15.2.1”

Edit the Shortcut properties

Right-Mouse-Click on Symbol and then select Properties:

Change Destination to:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit D:\Development\Environments\NodeJS\15.2.1\set_env.ps1


Call the powershell program


With the parameter


And the parameter


Which means:

Call Poweshell to run the script set_env.ps1 and stay in Powershell after the Script is finished.

Configure with .npmrc

Create a configuraton file .npmrc in the folder $HOME_NODE (e.g. D:\Development\Environments\NodeJS\15.2.1) using your favourite editor.

notepad D:\Development\Environments\NodeJS\15.2.1\.npmrc

Add this line to the file:


Save the file

Run the script

Double-Click on the shortcut