Package: nodeenv
Node.js virtual environmentnodeenv(node.js virtual environment) is a tool to create
isolated node.js environments.It creates an environment that has its own installation directories,
that doesn’t share libraries with other node.js virtual environments.Also the new environment can be integrated with the environment which was built
byvirtualenv(python).If you use nodeenv feel free to add your project on wiki:Who-Uses-Nodeenv.InstallGlobal installationLocal installationDependencyFor nodeenvFor node.jsUsageBasicAdvancedConfigurationAlternativesInstallGlobal installationYou can install nodeenv globally witheasy_install:$ sudo easy_install nodeenvor withpip:$ sudo pip install nodeenvor on Debian usingdpkg:$ ln -s debian-upstream debian
$ dpkg-buildpackage -uc -us -b
$ sudo dpkg -i $(ls -1rt ../nodeenv_*.deb | tail -n1)Local installationIf you’re usingvirtualenvthen you can install nodeenv viapip/easy_installinside any virtual environment built with virtualenv:$ virtualenv env
$ . env/bin/activate
(env) $ pip install nodeenv
(env) $ nodeenv --version
0.6.5If you want to work with the latest version of the nodeenv you can
install it from the githubrepository:$ git clone https://github.com/ekalinin/nodeenv.git
$ ./nodeenv/nodeenv.py --helpor withpip:$ pip install -e git+https://github.com/ekalinin/nodeenv.git#egg=nodeenvDependencyFor nodeenvpython (2.6+, 3.5+, or pypy)maketailFor node.jslibssl-devUsageBasicCreate new environment:$ nodeenv envActivate new environment:$ . env/bin/activateCheck versions of main packages:(env) $ node -v
v0.10.26

(env) $ npm -v
1.4.3Deactivate environment:(env) $ deactivate_nodeAdvancedGet available node.js versions:$ nodeenv --list
0.0.1   0.0.2   0.0.3   0.0.4   0.0.5   0.0.6   0.1.0
0.1.2   0.1.3   0.1.4   0.1.5   0.1.6   0.1.7   0.1.8
0.1.10  0.1.11  0.1.12  0.1.13  0.1.14  0.1.15  0.1.16
0.1.18  0.1.19  0.1.20  0.1.21  0.1.22  0.1.23  0.1.24
0.1.26  0.1.27  0.1.28  0.1.29  0.1.30  0.1.31  0.1.32
0.1.90  0.1.91  0.1.92  0.1.93  0.1.94  0.1.95  0.1.96
0.1.98  0.1.99  0.1.100 0.1.101 0.1.102 0.1.103 0.1.104
0.2.1   0.2.2   0.2.3   0.2.4   0.2.5   0.2.6   0.3.0
0.3.2   0.3.3   0.3.4   0.3.5   0.3.6   0.3.7   0.3.8
0.4.1   0.4.2   0.4.3   0.4.4   0.4.5   0.4.6Install node.js “0.4.3” without ssl support with 4 parallel commands
for compilation and npm.js “0.3.17”:$ nodeenv --without-ssl --node=0.4.3 --npm=0.3.17 --with-npm --jobs=4 env-4.3Install node.js from the source:$ nodeenv --node=0.10.25 --source env-0.10.25Install node.js from a mirror:$ nodeenv --node=10.19.0 --mirror=https://npm.taobao.org/mirrors/nodeIt’s much faster to install from the prebuilt package than Install & compile
node.js from source:$ time nodeenv --node=0.10.25 --prebuilt env-0.10.25-prebuilt
 + Install node.js (0.10.25) ... done.

real    0m6.928s
user    0m0.408s
sys     0m1.144s

$ time nodeenv --node=0.10.25 --source env-0.10.25-src
 + Install node.js (0.10.25) ... done.

real    4m12.602s
user    6m34.112s
sys     0m30.524sCreate a new environment with the system-wide node.js:$ nodeenv --node=systemSaving the versions of all installed packages to a file:$ . env-4.3/bin/activate
(env-4.3)$ npm install -g express
(env-4.3)$ npm install -g jade
(env-4.3)$ freeze ../prod-requirements.txtIf you want to list locally installed packages use-loption:(env-4.3)$ freeze -l ../prod-requirements.txtCreate an environment from a requirements file:$ nodeenv --requirements=../prod-requirements.txt --jobs=4 env-copyRequirements files are plain text files that contain a list of packages
to be installed. These text files allow you to create repeatable installations.
Requirements file example:$ cat ../prod-requirements.txt
connect@1.3.0
express@2.2.2
jade@0.10.4
mime@1.2.1
npm@0.3.17
qs@0.0.7If you already have the python virtualenv tool, and want to use nodeenv and
virtualenv in conjunction, then you should create (or activate) the python
virtual environment:# in case of using virtualenv_wrapper
$ mkvirtualenv my_env

# in case of using virtualenv
$ . my_env/bin/activateand add a node virtual environment to this existing new_venv:$ nodeenv -pIf you need to set the path to make used to build node:$ nodeenv -m /usr/local/bin/gmake ENVThat’s all. Now, all your node.js modules will be installed into your virtual
environment:$ workon my_env
$ npm install -g coffee-script
$ which coffee
/home/monty/virtualenvs/my_env/bin/coffeeCreating a virtual environment with a custom prompt:$ nodeenv –node=12.18.2 –prompt=”(myenv)” nodeenvIf environment’s directory already exists then you can use--forceoption:$ nodeenv --requirements=requirements.txt --jobs=4 --force envIf you already have an environment and want to update packages from requirements
file you can use--updateoption:$ . env-4.3/bin/activate
(env-4.3)$ nodeenv --requirements=requirements.txt --update env-4.3If you want to call node from environment without activation then you should
useshimscript:$ ./env-4.3/bin/shim --version
v0.4.3ConfigurationYou can use the INI-style file~/.nodeenvrcto set default values for many options,
the keys in that file are the long command-line option names.These are the available options and their defaults:[nodeenv]
node = 'latest'
npm = 'latest'
with_npm = False
jobs = '2'
without_ssl = False
debug = False
profile = False
make = 'make'
prebuilt = True
ignore_ssl_certs = False
mirror = NoneAlternativesThere are several alternatives that create isolated environments:nave- Virtual Environments for Node.
Nave stores all environments in one directory~/.nave. Can create
per node version environments usingnave use envname versionname.
Can not pass additional arguments into configure (for example –without-ssl)
Can’t run on windows because it relies on bash.nvm- Node Version
Manager. It is necessarily to donvm syncfor caching available node.js
version.
Can not pass additional arguments into configure (for example –without-ssl)virtualenv- Virtual Python Environment builder. For python only.LICENSEBSD /LICENSENodeenv changelogVersion 1.3.1Windows related fix#207Fixed url for arm64#210Fixed fish support#212Version 1.3.0Fixed symlink creation#189Python3.6 support#200Addedactivatefor fish#201Fixed cp866#202Added Conda support#203Version 1.2.0Support for Cygwin#194#195tox.ini as default configuration file#197Version 1.1.4Fixed directory copy#188Version 1.1.3Fixed spaces in paths#187Version 1.1.2Fixed MANIFEST.in#184Version 1.1.1Improve Windows support. See#181Fix bug when downgrading using–force. See#183Environment creation fails with non-ASCII chars in path. See#49Version 1.1.0Windows supportVersion 1.0.0–prebuiltis default. See# 161Added–sourceoptionAdded support for theARM. See# 171Fixed issue with$PATH. See# 86Version 0.13.6Use https for nodejs.org. See# 129Version 0.13.5Improved user-agent identificationVersion 0.13.4Customuser-agent. See# 125,# 127Version 0.13.3Fixed env creation with non-ASCII chars in path. See# 49Fixed logging with unicode chars. See# 96Skip new lines at the end of requirements.txt. See# 122Fixed UnicodeDecodeError at build on non UTF-8 environment. See# 124Version 0.13.2Fixedfreezecommand. See# 121Version 0.13.1Fixed bug:nodeenv--listis raising TypeError. See# 117,# 118Version 0.13.0Removed deps fromsort,egrep,curl,tar.
See# 114,# 116.Version 0.12.3Fixed check for installed curl/tar/etc for py3.Version 0.12.2Added check for installed curl/egrep/sort/tar. See# 110,# 61Version 0.12.1Removed dep for lxml in favor of stdlib HTMLParser. See# 109Added integration with travis-ci. See# 109Added some tests. See# 109Version 0.12.0Added support for io.js (new option--iojs)Fixedget_last_stable_node_versionfor python3Version 0.11.1Disallow prefix overridden by .npmrc. See# 98,# 100,# 103Version 0.11.0Improved dpkg rules. See# 90Added –config-file option. See# 91Read “./setup.cfg” in addition to “~/.nodeenvrc” by default. See# 91Python3 compatibility. See# 92,# 93Version 0.10.0Added support for config file. See# 85Using of virtualenv detected via python not env variable. See# 87Fixedfreezefor zsh. See# 88Addednodejssymlink creation. See# 84Version 0.9.6Removedos.symlinkadded in# 76. See# 84Version 0.9.5Fixed a few spelling typos in README. See# 74Fixed example of using –update option in README. See# 74Improved args passing into shim script. See# 75Try to findnodejsif used system-wide node as well. See# 76Addedassertif used system-wide node and it wasnt found. See# 76Added-loption intofreezecommand. See# 71Version 0.9.4Fixed support for python2.6. See# 70Version 0.9.3Fixed npm when using prebuilt binaries on Mac OS X. See# 68Fixed usingsystemnode under python3.4. See# 43If usedsystemnode scriptbin/nodealways overwrittenVersion 0.9.2Fixed infinite loop when system-wide node used. See# 67Version 0.9.1Fixed ‘shim’ script if used system-wide nodeFixed shebang in the ‘shim’Added shim with name ‘node’ in case of using system-wide nodeVersion 0.9.0Addedshimscript. See# 59Version 0.8.2Fixed prebuilt installation:cp more choosy. See# 64exclude top-level files in prebuilt tar. See# 63Version 0.8.1Fixed system’s node usage. See# 62Version 0.8.0Added support for prebuilt packages. See# 56Added support for python3. See# 42Version 0.7.3Fixed npm.js redirect. See# 52Added--updateoption. See# 25Version 0.7.2Bug fixing infreeze. See# 47Version 0.7.1Added--makeoptionVersion 0.7.0added--force. See# 37python3 support (first steps). See# 38,# 39escaping all directories used by subprocesses. See# 40added an option to use system-wide node. See# 41Version 0.6.6Fixed incomplete package names using freeze. See# 35Fixed packages installation type in README. See# 33Version 0.6.5Node’s source not loaded if it already exists in FS.Version 0.6.4Added python3 compatibility. See# 32Version 0.6.3Fixednodeenv-p. Seeissue # 31Version 0.6.2Skipped stand-alone npm installation by default. Seepull # 30--without-npmhas been changed to--with-npm. Seepull # 30Fixed options for running Make instances in parallel. Seepull # 30Version 0.6.1Used pkg_resources.parse_version to compare versions. Seepull # 29Fixed doubling prompt inside a virtualenv. Seeissues # 26Version 0.6.0Fixed typo in deactive command. Seepull # 20Not used “–insecure” to download npm. Seepull # 21Removed “src” directory after installation. Seepull # 22Added option “–clean-src”Added integration with python’s virtualenv. Seepull # 23Version 0.5.3Bug fix. Used https, /dist/latest/. Seepull # 16Version 0.5.2Improved installation logic for release candidate versions. Seepull # 10Version 0.5.1Improved logic for the option ‘–without-npm’. Seeissue # 14,pull # 15Version 0.5.0The virtual environment’s path is no longer hardcoded into the
activation script. Seepull # 13Version 0.4.3Fixed metavar for--npmnpm install-gused for npm >=1.0, not noly forlatestVersion 0.4.2Added README.ru.rstVersion 0.4.1Fixed bug in print_node_versions. Seepull # 11Added deps in READMEVersion 0.4.0Compatibility with virtualenv (renamed deactivate to deactivate_node).
Seepull # 9,issue # 6Version 0.3.10Fixed bug in url detection for node.js downloadVersion 0.3.9Deleted notify method calls. Seepull # 7Updated tar url for node.js > 0.5.0. Seepull # 8Version 0.3.8AddedNODE_PATHvariable export (for correct module
search after installation via npm)Version 0.3.7Shows command output when error occursExcluded ‘npm’ fromfreezelistFixed bug with ‘not only letter’ names infreezelistAdded global installation for npm >= 1.0 (when install
soft from requirement file)Version 0.3.6Fixedfreezeoutput command. Seerequest # 5Diagnostic message fixed. Seepull # 4Version 0.3.5Added option--npmto install certain npm.js version.Request.Fixedfreezecommand for npm >= 1.0.x.Version 0.3.4Fixedproblem #2with new npm installation script. Added--no-npm-cleanoption. The default to the npm 0.x cleanup.Version 0.3.3Fixedproblem #1with installation from PyPI via easy_install.
AddedMANIFEST.infile.Version 0.3.2Internal improvementsLogging refactoringVersion 0.3.1Default environment promt is folder nameVersion 0.3.0Renamed nve to nodeenv