Skip to content
Myr

[readme] add section on bare `nvm install`

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

authored by Justin Dhillon · committed by Jordan Harband · parent 2426a0c · Browse files · 1 file+14 added−1 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+14 added−1 removed

  • other:+14 added−1 removed

1 file+14 added−1 removed

modified:README.md+14 added-1 removed
540 unmodified lines
541```542543[NB these examples assume a POSIX-compliant shell version of `echo`. If you use a Windows `cmd` development environment, eg the `.nvmrc` file is used to configure a remote Linux deployment, then keep in mind the `"`s will be copied leading to an invalid file. Remove them.]544545Then when you run nvm:545Then when you run nvm use:546547```sh548$ nvm use549Found '/path/to/project/.nvmrc' with version <5.9>550Now using node v5.9.1 (npm v3.7.3)551```552553Running nvm install will also switch over to the correct version, but if the correct node version isn't already installed, it will install it for you.554555```sh556$ nvm install557Found '/path/to/project/.nvmrc' with version <5.9>558Downloading and installing node v5.9.1...559Downloading https://nodejs.org/dist/v5.9.1/node-v5.9.1-linux-x64.tar.xz...560#################################################################################### 100.0%561Computing checksum with sha256sum562Checksums matched!563Now using node v5.9.1 (npm v3.7.3)564```565566`nvm use` et. al. will traverse directory structure upwards from the current directory looking for the `.nvmrc` file. In other words, running `nvm use` et. al. in any subdirectory of a directory with an `.nvmrc` will result in that `.nvmrc` being utilized.567568The contents of a `.nvmrc` file **must** be the `<version>` (as described by `nvm --help`) followed by a newline. No trailing spaces are allowed, and the trailing newline is required.569
491 unmodified lines