Fixes #995: Add example .nvmrc to the README

Vincent Tunru 2016-03-26 12:48:28 +01:00
parent 273ebedc55
commit b6f160a7b3
1 changed files with 15 additions and 3 deletions

View File

@ -70,9 +70,6 @@ After upgrading, don't forget to activate the new version:
## Usage ## Usage
You can create an `.nvmrc` file containing version number in the project root directory (or any parent directory).
`nvm use`, `nvm install`, `nvm exec`, `nvm run`, and `nvm which` will all respect an `.nvmrc` file when a version is not supplied.
To download, compile, and install the latest v5.0.x release of node, do this: To download, compile, and install the latest v5.0.x release of node, do this:
nvm install 5.0 nvm install 5.0
@ -158,6 +155,21 @@ To use a mirror of the iojs binaries, set `$NVM_IOJS_ORG_MIRROR`:
`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. `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.
### .nvmrc
You can create a `.nvmrc` file containing version number in the project root directory (or any parent directory).
`nvm use`, `nvm install`, `nvm exec`, `nvm run`, and `nvm which` will all respect an `.nvmrc` file when a version is not supplied.
For example, to make nvm default to the latest 5.9 release for the current directory:
$ echo "5.9" > .nvmrc
Then when you run nvm:
$ nvm use
Found '/path/to/project/.nvmrc' with version <5.9>
Now using node v5.9.1 (npm v3.7.3)
### Deeper Shell Integration ### Deeper Shell Integration
You can use [`avn`](https://github.com/wbyoung/avn) to deeply integrate into your shell and automatically invoke `nvm` when changing directories. `avn` is **not** supported by the `nvm` development team. Please [report issues to the `avn` team](https://github.com/wbyoung/avn/issues/new). You can use [`avn`](https://github.com/wbyoung/avn) to deeply integrate into your shell and automatically invoke `nvm` when changing directories. `avn` is **not** supported by the `nvm` development team. Please [report issues to the `avn` team](https://github.com/wbyoung/avn/issues/new).