Beitragsbild: NodeJS

Node JS | 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.

All NodeJS Archives are here:${dist_version}/node-v${dist_version}"
Version32 Bit64 Bit

So, NodeJS 18.0.0 Files should be extracted to:

 #YOUR ROOT#\Environments\NodeJS\18.0.0\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-v18.0.0-win-x86.

We will call this installation folder HOME_NODE.

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

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 set_env.ps1 to setup up environment variables and path:


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


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



Write-Host "╔═══════════════════════════════════════════════════════════════════════════════════════════════════════╗"
Write-Host "║                                              Node JS                                                  ║"
Write-Host "╚═══════════════════════════════════════════════════════════════════════════════════════════════════════╝"

npm config set registry "$ENV:NPM_CONFIG_REGISTRY"

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

Depending on your security settings, you must sign the script.

Read here on how to do this.

Fix for Version 18.x.x

Using the original archive, you may get an error when you run node.exe

To fix this, set the environment variable OPENSSL_CONF (as we already did in set_env.ps1)


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 18.0.0“

Edit the Shortcut properties

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

Change Destination to:

powershell.exe -noexit D:\Development\Environments\NodeJS\18.0.0\set_env.ps1


Call the PowerShell program


With the parameter


And the parameter


Which means:

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

Configure with .npmrc

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

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

Add this line to the file:


Save the file

Run the script

Double-Click on the shortcut

Tipps und Tricks

Install Build Tools

Some packages need to build from source. These packages require additional tool, e.g. compiler.

Install all the required tools and configurations using Microsoft’s windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

npm install --global --production windows-build-tools

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

de German