nodeenv: Isolated node runtimes on MacOS

nodeenv allows to create isolated node runtimes per project which resembles to virtual environments in python world. In enterprise projects, where multiple projects are built against different versions of node runtime and dependencies, it is advantageous to have nodeenv to install multiple versions of node runtimes at project level.

Install nodeenv

brew install nodeenv

or

pip install nodeenv

List available node runtime versions

nodeenv --list

Create latest node version as virtual environment

nodeenv env

Create a specific node version as virtual environment

nodeenv --node=14.15.0 env

Activate a virtual environment

source env/bin/activate

Verify node and npm version

node --version
npm --version

Install a package scoped to the virutal environment

npm install -g cypress

Deactivate or exit from virtual environment

deactivate_node

Delete the virtual environment

rm -rf env


Comments

Popular posts from this blog

JSON with curl and jq

Import self signed in Linux for Chrome / Chromium headless testing

Colima - Drop In replacement for Docker Desktop for Mac and Linux