Skip to content
Myr

[Docs] update README for LTS.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 876d117 · Browse files · 1 file+27 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+27 added−9 removed

  • other:+27 added−9 removed

1 file+27 added−9 removed

modified:README.markdown+27 added-9 removed
26 unmodified lines
27 - When using nvm you do not need `sudo` to globally install a module with `npm -g`, so instead of doing `sudo npm install -g grunt`, do instead `npm install -g grunt`28 - If you have an `~/.npmrc` file, make sure it does not contain any `prefix` settings (which is not compatible with nvm)29 - You can (but should not?) keep your previous "system" node install, but nvm will only be available to your user account (the one used to install nvm). This might cause version mismatches, as other users will be using `/usr/local/lib/node_modules/*` VS your user account using `~/.nvm/versions/node/vX.X.X/lib/node_modules/*`3031Homebrew installation is not supported.31Homebrew installation is not supported. If you have issues with homebrew-installed `nvm`, please `brew uninstall` it, and install it using the instructions below, before filing an issue.3233Note: If you're using `zsh` you can easily install `nvm` as a zsh plugin. Install [`zsh-nvm`](https://github.com/lukechilds/zsh-nvm) and run `nvm_update` to update.3435### Install script
75 unmodified lines
111```112113## Usage114115To download, compile, and install the latest v5.0.x release of node, do this:115To download, compile, and install the latest release of node, do this:116117```sh118nvm install 5.0118nvm install node119```120121And then in any new shell just use the installed version:122123```sh124nvm use 5.0124nvm use node125```126127Or you can just run it:128129```sh130nvm run 5.0 --version130nvm run node --version131```132Or, you can run any arbitrary command in a subshell with the desired version of node:133134```sh
12 unmodified lines
147 - `iojs`: this installs the latest version of [`io.js`](https://iojs.org/en/)148 - `stable`: this alias is deprecated, and only truly applies to `node` `v0.12` and earlier. Currently, this is an alias for `node`.149 - `unstable`: this alias points to `node` `v0.11` - the last "unstable" node release, since post-1.0, all node versions are stable. (in semver, versions communicate breakage, not stability).150151### Long-term support152Node has a [schedule](https://github.com/nodejs/LTS#lts_schedule) for long-term support (LTS) You can reference LTS versions in aliases and `.nvmrc` files with the notation `lts/*` for the latest LTS, and `lts/argon` for LTS releases from the "argon" line, for example. In addition, the following commands support LTS arguments:153 - `nvm install --lts` / `nvm install --lts=argon`154 - `nvm uninstall --lts` / `nvm uninstall --lts=argon`155 - `nvm use --lts` / `nvm use --lts=argon`156 - `nvm exec --lts` / `nvm exec --lts=argon`157 - `nvm run --lts` / `nvm run --lts=argon`158 - `nvm ls-remote --lts` / `nvm ls-remote --lts=argon`159 - `nvm version-remote --lts` / `nvm version-remote --lts=argon`160161Any time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported.162163### Migrating global packages while installing164If you want to install a new version of Node.js and migrate npm packages from a previous version:165166```sh167nvm install node --reinstall-packages-from=node
3 unmodified lines
171172You can also install and migrate npm packages from specific versions of Node like this:173174```sh162nvm install v5.0 --reinstall-packages-from=4.2175nvm install 6 --reinstall-packages-from=5176nvm install v4.2 --reinstall-packages-from=iojs177```178179### io.js180If you want to install [io.js](https://github.com/iojs/io.js/):181182```sh183nvm install iojs
6 unmodified lines
190```191192The same guidelines mentioned for migrating npm packages in Node.js are applicable to io.js.193194### System version of node195If you want to use the system-installed version of node, you can use the special default alias "system":196197```sh198nvm use system199nvm run system --version200```201202### Listing versions203If you want to see what versions are installed:204205```sh206nvm ls
25 unmodified lines
232233NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 4.2234```235220To use a mirror of the iojs binaries, set `$NVM_IOJS_ORG_MIRROR`:236To use a mirror of the io.js binaries, set `$NVM_IOJS_ORG_MIRROR`:237238```sh239export NVM_IOJS_ORG_MIRROR=https://iojs.org/dist240nvm install iojs-v1.0.3241242NVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3243```244229`nvm use` will not, by default, create a "current" symlink. Set `$NVM_SYMLINK_CURRENT` to "true" to enable this behavior, which is sometimes useful for IDEs.245`nvm use` will not, by default, create a "current" symlink. Set `$NVM_SYMLINK_CURRENT` to "true" to enable this behavior, which is sometimes useful for IDEs. Note that using `nvm` in multiple shell tabs with this environment variable enabled can cause race conditions.246247### .nvmrc248249You can create a `.nvmrc` file containing version number in the project root directory (or any parent directory).
2 unmodified lines
252For example, to make nvm default to the latest 5.9 release for the current directory:253254```sh255$ echo "5.9" > .nvmrc256257$ echo "lts/*" > .nvmrc # to default to the latest LTS version258```259260Then when you run nvm:261
35 unmodified lines
297298nvm is released under the MIT license.299300283Copyright (C) 2010-2016 Tim Caswell301Copyright (C) 2010-2016 Tim Caswell and Jordan Harband302303Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:304305The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
126 unmodified lines