Description
Node.js virtual environment =========================== ``nodeenv`` (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 by virtualenv_ (python). If you use nodeenv feel free to add your project on wiki: `Who-Uses-Nodeenv`_. .. _Who-Uses-Nodeenv: https://github.com/ekalinin/nodeenv/wiki/Who-Uses-Nodeenv .. image:: https://github.com/ekalinin/nodeenv/actions/workflows/main.yml/badge.svg?branch=master :target: https://github.com/ekalinin/nodeenv/actions/workflows/main.yml :alt: CI .. contents:: :local: Install ------- Global installation ^^^^^^^^^^^^^^^^^^^ You can install nodeenv globally with `easy_install`_:: $ sudo easy_install nodeenv or with `pip`_:: $ sudo pip install nodeenv or on Debian using `dpkg`_:: $ ln -s debian-upstream debian $ dpkg-buildpackage -uc -us -b $ sudo dpkg -i $(ls -1rt ../nodeenv_*.deb | tail -n1) .. _dpkg: https://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html Local installation ^^^^^^^^^^^^^^^^^^ If you're using virtualenv_ then you can install nodeenv via pip_/easy_install_ inside any virtual environment built with virtualenv:: $ virtualenv env $ . env/bin/activate (env) $ pip install nodeenv (env) $ nodeenv --version 0.6.5 If you want to work with the latest version of the nodeenv you can install it from the github `repository`_:: $ git clone https://github.com/ekalinin/nodeenv.git $ ./nodeenv/nodeenv.py --help or with `pip`_:: $ pip install -e git+https://github.com/ekalinin/nodeenv.git#egg=nodeenv .. _repository: https://github.com/ekalinin/nodeenv .. _pip: http://pypi.python.org/pypi/pip .. _easy_install: http://pypi.python.org/pypi/setuptools Dependency ---------- For nodeenv ^^^^^^^^^^^ * python (2.6+, 3.5+, or pypy) * make * tail For node.js ^^^^^^^^^^^ * libssl-dev Usage ----- Basic ^^^^^ Create new environment:: $ nodeenv env Activate new environment:: $ . env/bin/activate Check versions of main packages:: (env) $ node -v v0.10.26 (env) $ npm -v 1.4.3 Deactivate environment:: (env) $ deactivate_node Advanced ^^^^^^^^ Get 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.6 Install 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.3 Install node.js from the source:: $ nodeenv --node=0.10.25 --source env-0.10.25 Install node.js from a mirror:: $ nodeenv --node=10.19.0 --mirror=https://npm.taobao.org/mirrors/node It'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.524s Create a new environment with the system-wide node.js:: $ nodeenv --node=system Saving 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.txt If you want to list locally installed packages use ``-l`` option:: (env-4.3)$ freeze -l ../prod-requirements.txt Create an environment from a requirements file:: $ nodeenv --requirements=../prod-requirements.txt --jobs=4 env-copy Requirements 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.7 If 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/activate and
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 1.10.0 | Imported from PyPI (1.10.0) | Low | 4/21/2026 |
| 1.9.1 | - #358 (#356, #356 ) | Low | 6/4/2024 |
| 1.9.0 | - #338 - #347 - #348 - #345 - #342 - #346 | Low | 5/28/2024 |
| 1.8.0 | Changes: - #312 - #313 - #317 - #320 - #327 - #329 - #330 | Low | 5/12/2023 |
| 1.7.0 | * #272 * #289 * #288 * #294 * #296 * #295 * #298 * #299 * #307 * #308 | Low | 6/25/2022 |
| 1.6.0 | - #270 - #271 - #273 - #275 - #276 - #277 - #281 - #282 | Low | 4/9/2021 |
| 1.5.0 | - #259 - #256 - #263 - #268 | Low | 8/23/2020 |
| 1.4.0 | - #258 - #255 - #252 - #247 | Low | 6/2/2020 |
| 1.3.5 | - #249 | Low | 2/4/2020 |
| 1.3.4 | - #230 - #231 - #232 - #233 - #234 - #241 - #242 - #236 - #208 - #245 - #246 | Low | 1/7/2020 |
| 1.3.3 | - #225 | Low | 11/6/2018 |
| 1.3.2 | - #222 - #216 - #213 - drop py33 support | Low | 7/18/2018 |
| 1.3.1 | - Windows related fix #207 - Fixed url for arm64 #210 - Fixed fish support #212 | Low | 6/13/2018 |
| 1.3.0 | * #189 * #200 * #201 * #202 * #203 | Low | 3/21/2018 |
| 1.2.0 | * #194 , #195 * #197 | Low | 8/2/2017 |
| 1.1.4 | #188 (after #187) | Low | 6/29/2017 |
| 1.1.3 | * #187 | Low | 6/29/2017 |
| 1.1.2 | - #184 | Low | 2/3/2017 |
| 1.1.1 | - #181 - #183 - #49 | Low | 2/2/2017 |
| 1.1.0 | - #172 - #173 - #179 - #180 | Low | 1/20/2017 |
| 1.0.0 | - `--prebuilt` is default. See #161 - Added `--source` option - Added support for the `ARM`. See #171 - Fixed issue with `$PATH`. See #86 | Low | 9/9/2016 |
| 0.13.6 | - #129 | Low | 9/10/2015 |
| 0.13.5 | - Current user-agent: `'nodeenv/' + nodeenv_version + ' (https://github.com/ekalinin/nodeenv/)'` which is match convension for user agent strings[1]. Thanks to @tracker1 (from [here](https://github.com/ekalinin/nodeenv/commit/b53f3997c6d4797fc443eeb93592916d542de361#commitcomment-12975887)) [1] https://en.wikipedia.org/wiki/User_agent#Format_for_automated_agents_.28bots.29 | Low | 9/3/2015 |
| 0.13.4 | - #125 - #127 | Low | 8/31/2015 |
| 0.13.3 | - #49 - #96 - #122 - #124 | Low | 7/21/2015 |
| 0.13.2 | - Fixed freeze command. See # 121 | Low | 7/16/2015 |
| 0.13.1 | Fixed bug: `nodeenv --list is raising TypeError`. See #117, #118 | Low | 3/17/2015 |
| 0.13.0 | - Removed deps from `sort`, `egrep`, `curl`, `tar`. See #114, #116 | Low | 3/3/2015 |
| 0.12.3 | - Fixed check for installed curl/tar/etc for py3. See #110, #61 | Low | 1/19/2015 |
| 0.12.2 | - Added check for installed curl/egrep/sort/tar. See #110, #61 | Low | 1/19/2015 |
| 0.12.1 | - Removed dep for lxml in favor of stdlib HTMLParser. See #109 - Added integration with travis-ci. See #109 - Added some tests. See #109 | Low | 1/19/2015 |
| 0.12.0 | - added support for io.js (new option `--iojs`) - fixed `get_last_stable_node_version` for python3 | Low | 1/15/2015 |
| 0.11.1 | - Disallow prefix overridden by .npmrc. See #98, #100, #103 | Low | 9/4/2014 |
| 0.11.0 | - Improved dpkg rules. See #90 - Added --config-file option. See #91 - Read "./setup.cfg" in addition to "~/.nodeenvrc" by default. See #91 - Python3 compatibility. See #92, #93 | Low | 7/22/2014 |
| 0.10.0 | - Added support for config file. See #85 - Using of virtualenv detected via python not env variable. See #87 - Fixed `freeze` for zsh. See #88 - Added `nodejs` symlink creation. See #84 | Low | 7/11/2014 |
| 0.9.6 | - Removed `os.symlink` added in #76. See #84 | Low | 6/19/2014 |
| 0.9.5 | - Fixed a few spelling typos in README. See #74 - Fixed example of using --update option in README. See #74 - Improved args passing into shim script. See #75 - Try to find `nodejs` if used system-wide node as well. See #76 - Added `assert` if used system-wide node and it wasnt found. See #76 - Added `-l` option into `freeze` command. See #71 | Low | 6/17/2014 |
| 0.9.4 | - Fixed support for python2.6. See #70 | Low | 6/17/2014 |
| 0.9.3 | - Fixed `npm` when using prebuilt binaries on Mac OS X. See #68 - Fixed using `system` node under python3.4. See #43 - If used `system` node script `bin/node` always overwritten | Low | 6/17/2014 |
| 0.9.2 | - Fixed infinite loop inside virtualenv when system-wide node used. See #67 | Low | 5/15/2014 |
| 0.9.1 | - Fixed `shim` script if used system-wide node - Fixed shebang in the `shim` - Added shim with name `node` in case of using system-wide node | Low | 5/13/2014 |
| 0.9.0 | - added `shim` script for using node from environment without activating it. See #59 - `install_node` function wplitted into `copy_node_from_prebuilt`/`build_node_from_src` | Low | 5/13/2014 |
| 0.8.2 | - Fixed prebuilt installation: - cp more choosy. #64, #65 - exclude top-level files in prebuilt tar. #63, #66 | Low | 5/13/2014 |
| 0.8.1 | - fixed system's node usage #62 | Low | 5/7/2014 |
| 0.8.0 | - Added support for python3 (#42 , #58) - Added support for prebuilt packages (#56) | Low | 4/3/2014 |
| 0.7.3 | - Fixed npm.js redirect. See #52 - Added `--update` option. See #25 | Low | 3/19/2014 |
| 0.7.2 | - Fixed some bugs in regexps in the `freeze` command. See #47 | Low | 1/9/2014 |
| 0.7.1 | - added `--make`/`-m` option for path to make #44 | Low | 11/8/2013 |
| 0.7.0 | - added `--force` option. See #37 - python3 support (first steps). See #38, #39 - escaping all directories used by subprocesses. See #40 - added `-n system` to use system-wide node. See #41 | Low | 9/13/2013 |
