diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a7d19..fd41c1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] (date goes here) +### Added + +- install instruction using homebrew (macOS) + ### Fixed - lts lookup on node mirrors which don't purge old versions (e.g. taobao) [#512][] diff --git a/README.md b/README.md index db3839e..a4d2c17 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,22 @@ to install `n` to `bin/n` of the directory specified in the environment variable Once installed, `n` installs `node` versions to subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`; the _active_ `node`/`iojs` version is installed directly in `N_PREFIX`. To change the default to, say, `$HOME`, prefix later calls to `n` with `N_PREFIX=$HOME ` or add `export N_PREFIX=$HOME` to your shell initialization file. -On macOS with [Homebrew](https://brew.sh/) you can install the [`n` formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/n.rb). Does not require installing `node` first. +### Third Party Installers + +On macOS with [Homebrew](https://brew.sh/) you can install the [`n` formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/n.rb). brew install n -Additionally, consider third-party installer [n-install](https://github.com/mklement0/n-install), which allows installation directly from GitHub; for instance, +On Linux and macOS, [n-install](https://github.com/mklement0/n-install) allows installation directly from GitHub; for instance: curl -L https://git.io/n-install | bash -sets both `PREFIX` and `N_PREFIX` to `$HOME/n`, installs `n` to `$HOME/n/bin`, modifies the initialization files of supported shells to export `N_PREFIX` and add `$HOME/n/bin` to the `PATH`, and installs the latest stable `node` version. +n-install sets both `PREFIX` and `N_PREFIX` to `$HOME/n`, installs `n` to `$HOME/n/bin`, modifies the initialization files of supported shells to export `N_PREFIX` and add `$HOME/n/bin` to the `PATH`, and installs the latest stable `node` version. As a result, both `n` itself and all `node` versions it manages are hosted inside a single, optionally configurable directory, which you can later remove with the included `n-uninstall` script. `n-update` updates `n` itself to the latest version. See the [n-install repo](https://github.com/mklement0/n-install) for more details. -### Installing/Activating Versions +## Installing/Activating Node Versions Simply execute `n ` to install a version of `node`. If `` has already been installed (via `n`), `n` will activate that version. A leading v is optional, and a partial version number installs the newest matching version. @@ -65,7 +67,7 @@ Use or install the latest LTS official release: $ n lts -### Removing Versions +## Removing Versions Remove some versions: @@ -81,7 +83,7 @@ Removing all versions except the current version: $ n prune ``` -### Binary Usage +## Binary Usage When running multiple versions of `node`, we can target them directly by asking `n` for the binary path: