0
0
mirror of https://github.com/tj/n.git synced 2024-11-21 18:48:57 +01:00

Rework install location description

This commit is contained in:
John Gee 2021-09-25 21:35:03 +12:00
parent b37b10e4a1
commit 7fa34d3f0c

View File

@ -37,9 +37,8 @@ If you already have Node.js installed, an easy way to install `n` is using `npm`
npm install -g n
Once installed, `n` caches Node.js versions in subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`.
The _active_ Node.js version is installed under `N_PREFIX`. (This creates subdirectories `bin`, `include`, `lib` and `share`.)
The `n` command downloads and installs to `/usr/local` by default, but you may override this location by defining `N_PREFIX`.
`n` caches Node.js versions in subdirectory `n/versions`. The _active_ Node.js version is installed in subdirectories `bin`, `include`, `lib`, and `share`.
To avoid requiring `sudo` for `n` and `npm` global installs, it is suggested you either install to your home directory using `N_PREFIX`, or take ownership of the system directories:
@ -71,7 +70,7 @@ to install `n` to `bin/n` of the directory specified in the environment variable
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
Or on macOS with [MacPorts](https://www.macports.org/) you can install the [n port](https://ports.macports.org/port/n/summary):
port install n
@ -234,9 +233,10 @@ There is also `N_NODE_DOWNLOAD_MIRROR` for a different mirror with same layout a
## Custom Architecture
By default `n` picks the binaries matching your system architecture. For example, on a 64 bit system `n` will download 64 bit binaries.
By default `n` picks the binaries matching your system architecture. For example, on a 64 bit system `n` will download 64 bit binaries.
On a Mac with Apple silicon:
- for Node.js 16 and higher, `n` defaults to arm64 binaries which run natively
- for older versions of Node.js, `n` defaults to x64 binaries which run in Rosetta 2