Node Js Version 8 Download for Mac

northward – Interactively Manage Your Node.js Versions

npm npm npm npm

Node.js version management: no subshells, no contour setup, no convoluted API, but uncomplicated.

usage animation

Supported Platforms

due north is supported on macOS, Linux, including with Windows Subsystem for Linux, and various other unix-like systems. It is written as a BASH script but does not require you to use BASH as your control vanquish.

n does non work in native shells on Microsoft Windows (similar PowerShell), or Git for Windows BASH, or with the Cygwin DLL.

Installation

If you already have Node.js installed, an easy way to install n is using npm:

              npm install -g north                          

The n command downloads and installs to /usr/local by default, but you may override this location by defining N_PREFIX. due north 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:

              # make cache folder (if missing) and accept ownership sudo mkdir -p /usr/local/northward sudo chown -R $(whoami) /usr/local/n # brand sure the required folders exist (safe to execute even if they already exist) sudo mkdir -p /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share # take ownership of Node.js install destination folders sudo chown -R $(whoami) /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share                          

If npm is not however available, one style to bootstrap an install:

              curl -50 https://raw.githubusercontent.com/tj/n/main/bin/northward -o northward bash due north lts # Now node and npm are bachelor npm install -g n                          

Alternatively, you tin clone this repo and

              make install                          

to install n to bin/n of the directory specified in the environment variable $PREFIX, which defaults to /usr/local (notation that y'all will probable need to utilise sudo). To install n in a custom location (such every bit $CUSTOM_LOCATION/bin/north), run PREFIX=$CUSTOM_LOCATION make install.

Third Party Installers

On macOS with Homebrew you tin install the n formula.

              brew install n                          

Or on macOS with MacPorts you can install the n port:

              port install n                          

On Linux and macOS, northward-install allows installation directly from GitHub; for instance:

              curl -Fifty https://git.io/n-install | bash                          

north-install sets both PREFIX and N_PREFIX to $Dwelling/n, installs north to $Habitation/due north/bin, modifies the initialization files of supported shells to consign N_PREFIX and add $Habitation/n/bin to the PATH, and installs the latest LTS Node.js version.

As a result, both n itself and all Node.js versions information technology manages are hosted inside a single, optionally configurable directory, which you can later remove with the included north-uninstall script. n-update updates n itself to the latest version. Encounter the n-install repo for more details.

Installing Node.js Versions

Simply execute n <version> to download and install a version of Node.js. If <version> has already been downloaded, n will install from its cache.

              n x.xvi.0 n lts                          

Execute n on its own to view your downloaded versions, and install the selected version.

              $ due north    node/4.9.1 ο node/eight.11.3   node/10.xv.0  Utilise up/downwardly arrow keys to select a version, return primal to install, d to delete, q to quit                          

(You can also utilize j and thousand to select next or previous version instead of using arrows, or ctrl+n and ctrl+p.)

If the agile node version does not change afterwards install, attempt opening a new beat out in case seeing a stale version.

Specifying Node.js Versions

There are a diverseness of ways of specifying the target Node.js version for northward commands. Most commands use the latest matching version, and due north ls-remote lists multiple matching versions.

Numeric version numbers can be complete or incomplete, with an optional leading five.

  • 4.ix.i
  • eight: 8.ten.y versions
  • v6.1: 6.one.x versions

There are labels for two particularly useful versions:

  • lts: newest Long Term Support official release
  • latest, current: newest official release

In that location is an auto label to read the target version from a file in the current directory, or any parent directory. n looks for in gild:

  • .n-node-version: version on single line. Custom to due north.
  • .node-version: version on single line. Used by multiple tools: node-version-usage
  • .nvmrc: version on single line. Used by nvm.
  • if no version file found, expect for engine as below.

The engine label looks for a package.json file and reads the engines field to determine uniform Node.js. Requires an installed version of node, and uses npx semver to resolve circuitous ranges.

There is back up for the named release streams:

  • argon, boron, carbon: codenames for LTS release streams

These Node.js back up aliases may be used, although simply resolve to the latest matching version:

  • active, lts_active, lts_latest, lts, electric current, supported

The last version form is for specifying other releases available using the name of the remote download folder optionally followed by the complete or incomplete version.

  • nightly
  • test/v11.0.0-test20180528
  • rc/10

Removing Versions

Remove some cached versions:

              north rm 0.ix.4 v0.10.0                          

Removing all cached versions except the installed version:

              n prune                          

Remove the installed Node.js (does not bear on the cached versions). This can exist useful to revert to the arrangement version of node (if in a different location), or if you no longer wish to use node and npm, or are switching to a different style of managing them.

              north uninstall                          

Using Downloaded Node.js Versions Without Reinstalling

In that location are three commands for working straight with your downloaded versions of Node.js, without reinstalling.

You can prove the path to the downloaded node version:

              $ n which 6.14.3 /usr/local/n/versions/half-dozen.fourteen.3/bin/node                          

Or run a downloaded node version with the n run command:

              n run 8.11.3 --debug some.js                          

Or execute a command with PATH modified and then node and npm will exist from the downloaded Node.js version. (NB: npm run this way will be using global node_modules from the target node version folder.)

              north exec x my-script --fast test n exec lts zsh                          

Preserving npm

A Node.js install normally includes npm too, just you may wish to preserve an updated npm and npx leaving them out of the install using --preserve:

              $ npm install -g npm@latest ... $ npm --version 6.13.7 $ due north -p 8    installed : v8.17.0 $ npm --version half-dozen.thirteen.7                          

Yous can make this the default past setting N_PRESERVE_NPM to a non-empty string.

              export N_PRESERVE_NPM=i                          

You lot can be explicit to get the desired behaviour whatever the surroundings variable:

              northward --preserve nightly n --no-preserve latest                          

Miscellaneous

Command line assist tin can be obtained from n --aid.

List matching remote versions bachelor for download:

              n ls-remote lts n ls-remote latest n lsr 10 n --all lsr                          

List downloaded versions in cache:

              northward ls                          

Display diagnostics to help resolve problems:

              n dr.                          

Custom Source

If you would like to use a different Node.js mirror which has the same layout equally the default https://nodejs.org/dist/, you tin define N_NODE_MIRROR. The nearly mutual example is from users in China who can define:

              export N_NODE_MIRROR=https://npmmirror.com/mirrors/node                          

If the custom mirror requires authentication you can add together the url-encoded username and password into the URL. e.g.

              export N_NODE_MIRROR=https://encoded-username:encoded-password@host:port/path                          

There is as well N_NODE_DOWNLOAD_MIRROR for a unlike mirror with same layout every bit the default https://nodejs.org/download.

Custom Architecture

Past default due north picks the binaries matching your system compages. For example, on a 64 flake arrangement n volition download 64 bit binaries.

On a Mac with Apple silicon:

  • for Node.js 16 and college, n defaults to arm64 binaries which run natively
  • for older versions of Node.js, n defaults to x64 binaries which run in Rosetta 2

Y'all tin can override the default compages by using the -a or --arch pick.

due east.thousand. reinstall latest version of Node.js with x64 binaries:

              north rm current n --arch x64 current                          

Optional Environment Variables

The north command downloads and installs to /usr/local past default, simply y'all may override this location by defining N_PREFIX. To change the location to say $Abode/.due north, add lines like the following to your shell initialization file:

              consign N_PREFIX=$Abode/.n consign PATH=$N_PREFIX/bin:$PATH                          

If you want to store the downloads nether a different location, apply N_CACHE_PREFIX. This does not affect the currently active node version.

n defaults to using xz compressed Node.js tarballs for the download if it is likely tar on the organisation supports xz decompression. You tin can override the automatic selection by setting an environment variable to zilch or non-null:

              consign N_USE_XZ=0 # to disable consign N_USE_XZ=ane # to enable                          

You can be explicit to get the desired behaviour whatever the environment variable:

              north install --use-xz nightly northward install --no-use-xz latest                          

In brief:

How Information technology Works

n downloads a prebuilt Node.js package and installs to a unmarried prefix (e.thousand. /usr/local). This overwrites the previous version. The bin folder in this location should be in your PATH (due east.grand. /usr/local/bin).

The downloads are kept in a cache folder to be used for reinstalls. The downloads are as well available for express use using due north which and northward run and n exec.

The global npm packages are not changed by the install, with the exception of npm itself which is part of the Node.js install.

Node Js Version 8 Download for Mac

Posted by: fisheraplues.blogspot.com