Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit a52f6f1

Browse files
lancemccluskeymanishprivetbenhalverson
authored
feat: adding page for package-manager (#1564)
* feat: adding page for package-manager * test: adding tests pm and download page * test: rm old download page test and snapshot * test: adding community page test * refactor: rm redundant toc in package-manager md file * refactor: adding download/package-manager to about page * style: adding copy text icon for code snippets * chore: rm gatsby copy button lib * chore: rm copy btn css from article * chore: overwriting my messed up pckg lock * chore: forgot newline * refactor: update content/download/package-manager.md Co-authored-by: Manish Kumar <manishprivet@protonmail.com> * refactor: making req changes * refactor: fixing graphql query * refactor: changing read documentation link on homepage * Update src/components/InstallTabs/LinuxPanel/index.tsx Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> * Update src/components/InstallTabs/MacOSPanel/index.tsx Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> * Update src/components/InstallTabs/WindowsPanel/index.tsx Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> * test: updating pesky snapshots Co-authored-by: Manish Kumar <manishprivet@protonmail.com> Co-authored-by: Ben Halverson <7907232+benhalverson@users.noreply.github.com>
1 parent 7911dca commit a52f6f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1573
-211
lines changed
Lines changed: 351 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,351 @@
1+
---
2+
title: Installing Node.js via package manager
3+
description: Installing Node.js via package manager
4+
authors: fhemberger, XhmikosR, shadowspawn, vsemozhetbyt, nschonni, wildcard, MrJithil, kasicka, cassidyjames, Trott, richardlau, Qantas94Heavy, pierreneter, 0mp, ThePrez, PoojaDurgad, MaledongGit, Megajin, marc-maurer, yodeyer, geek, sudowork, strawbrary, ryanmurakami, rbnswartz, arkwright, oliversalzburg, mweagle, Mohamed3on, Ginden, kapouer, jperkin, jericopulvera, jedsmith, jasonkarns, sonicdoe, mcollina, fornwall, danbev, naskapal, awochna, AdamMajer, ahmetanilgur, bnb, qbit
5+
category: download
6+
---
7+
8+
***Note:*** The packages on this page are maintained and supported by their respective packagers, **not** the Node.js core team. Please report any issues you encounter to the package maintainer. If it turns out your issue is a bug in Node.js itself, the maintainer will report the issue upstream.
9+
10+
## Android
11+
12+
Android support is still experimental in Node.js, so precompiled binaries are not yet provided by Node.js developers.
13+
14+
However, there are some third-party solutions. For example, [Termux](https://termux.com/) community provides terminal emulator and Linux environment for Android, as well as own package manager and [extensive collection](https://github.com/termux/termux-packages) of many precompiled applications. This command in Termux app will install the last available Node.js version:
15+
16+
```bash
17+
pkg install nodejs
18+
```
19+
20+
Currently, Termux Node.js binaries are linked against `system-icu` (depending on `libicu` package).
21+
22+
## Arch Linux
23+
24+
Node.js and npm packages are available in the Community Repository.
25+
26+
```bash
27+
pacman -S nodejs npm
28+
```
29+
30+
## CentOS, Fedora and Red Hat Enterprise Linux
31+
32+
Node.js is available as a module called `nodejs` in CentOS/RHEL 8 and Fedora.
33+
34+
```bash
35+
dnf module install nodejs:<stream>
36+
```
37+
38+
where `<stream>` corresponds to the major version of Node.js.
39+
To see a list of available streams:
40+
41+
```bash
42+
dnf module list nodejs
43+
```
44+
45+
For example, to install Node.js 12:
46+
47+
```bash
48+
dnf module install nodejs:12
49+
```
50+
51+
For CentOS/RHEL 7 Node.js is available via [Software Collections](https://www.softwarecollections.org/en/scls/?search=NodeJS).
52+
53+
### Alternatives
54+
55+
These resources provide packages compatible with CentOS, Fedora, and RHEL.
56+
* [Node.js snaps](#snap) maintained and supported at https://github.com/nodejs/snap
57+
* [Node.js binary distributions](#debian-and-ubuntu-based-linux-distributions) maintained and supported by [NodeSource](https://github.com/nodesource/distributions)
58+
59+
## Debian and Ubuntu based Linux distributions
60+
61+
[Node.js binary distributions](https://github.com/nodesource/distributions/blob/master/README.md) are available from NodeSource.
62+
63+
### Alternatives
64+
65+
Packages compatible with Debian and Ubuntu based Linux distributions are available via [Node.js snaps](#snap).
66+
67+
## fnm
68+
69+
Fast and simple Node.js version manager built in Rust used to manage multiple released Node.js versions. It allows you to perform operations like install, uninstall, switch Node versions automatically based on the current directory, etc.
70+
To install fnm, use this [install script](https://github.com/Schniz/fnm#using-a-script-macoslinux).
71+
72+
fnm has cross-platform support (macOS, Windows, Linux) & all poplar shells (Bash, Zsh, Fish, PowerShell, Windows Command Line Prompt)
73+
it's built with speed in mind and compatibility support for `.node-version` and `.nvmrc` files.
74+
75+
## FreeBSD
76+
77+
The most recent release of Node.js is available via the [www/node](https://www.freshports.org/www/node) port.
78+
79+
Install a binary package via [pkg](https://www.freebsd.org/cgi/man.cgi?pkg):
80+
81+
```bash
82+
pkg install node
83+
```
84+
85+
Or compile it on your own using [ports](https://www.freebsd.org/cgi/man.cgi?ports):
86+
87+
```bash
88+
cd /usr/ports/www/node && make install
89+
```
90+
91+
## Gentoo
92+
93+
Node.js is available in the portage tree.
94+
95+
```bash
96+
emerge nodejs
97+
```
98+
99+
## IBM i
100+
101+
LTS versions of Node.js are available from IBM, and are available via [the 'yum' package manager](https://ibm.biz/ibmi-rpms). The package name is `nodejs` followed by the major version number (for instance, `nodejs12`, `nodejs14` etc)
102+
103+
To install Node.js 14.x from the command line, run the following as a user with \*ALLOBJ special authority:
104+
105+
```bash
106+
yum install nodejs14
107+
```
108+
109+
Node.js can also be installed with the IBM i Access Client Solutions product. See [this support document](http://www-01.ibm.com/support/docview.wss?uid=nas8N1022619) for more details
110+
111+
## macOS
112+
113+
Download the [macOS Installer](https://nodejs.org/en/#home-downloadhead) directly from the [nodejs.org](https://nodejs.org/) web site.
114+
115+
_If you want to download the package with bash:_
116+
117+
```bash
118+
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
119+
```
120+
121+
### Alternatives
122+
123+
Using **[Homebrew](https://brew.sh/)**:
124+
125+
```bash
126+
brew install node
127+
```
128+
129+
Using **[MacPorts](https://www.macports.org/)**:
130+
131+
```bash
132+
port install nodejs<major version>
133+
134+
# Example
135+
port install nodejs7
136+
```
137+
138+
Using **[pkgsrc](https://pkgsrc.joyent.com/install-on-osx/)**:
139+
140+
Install the binary package:
141+
142+
```bash
143+
pkgin -y install nodejs
144+
```
145+
146+
Or build manually from pkgsrc:
147+
148+
```bash
149+
cd pkgsrc/lang/nodejs && bmake install
150+
```
151+
152+
## n
153+
154+
`n` is a simple to use Node.js version manager for Mac and Linux. Specify the target version to install using a rich syntax,
155+
or select from a menu of previously downloaded versions. The versions are installed system-wide or user-wide, and for more
156+
targeted use you can run a version directly from the cached downloads.
157+
158+
See the [homepage](https://github.com/tj/n) for install methods (boostrap, npm, Homebrew, third-party), and all the usage details.
159+
160+
If you already have `npm` then installing `n` and then the newest LTS `node` version is as simple as:
161+
162+
```bash
163+
npm install -g n
164+
n lts
165+
```
166+
167+
## NetBSD
168+
169+
Node.js is available in the pkgsrc tree:
170+
171+
```bash
172+
cd /usr/pkgsrc/lang/nodejs && make install
173+
```
174+
175+
Or install a binary package (if available for your platform) using pkgin:
176+
177+
```bash
178+
pkgin -y install nodejs
179+
```
180+
181+
## Nodenv
182+
183+
`nodenv` is a lightweight node version manager, similar to `nvm`. It's simple and predictable. A rich plugin ecosystem lets you tailor it to suit your needs. Use `nodenv` to pick a Node version for your application and guarantee that your development environment matches production.
184+
185+
Nodenv installation instructions are maintained [on its Github page](https://github.com/nodenv/nodenv#installation). Please visit that page to ensure you're following the latest version of the installation steps.
186+
187+
## nvm
188+
Node Version Manager is a bash script used to manage multiple released Node.js versions. It allows
189+
you to perform operations like install, uninstall, switch version, etc.
190+
To install nvm, use this [install script](https://github.com/nvm-sh/nvm#install--update-script).
191+
192+
On Unix / OS X systems Node.js built from source can be installed using
193+
[nvm](https://github.com/creationix/nvm) by installing into the location that nvm expects:
194+
195+
```bash
196+
env VERSION=`python tools/getnodeversion.py` make install DESTDIR=`nvm_version_path v$VERSION` PREFIX=""
197+
```
198+
199+
After this you can use `nvm` to switch between released versions and versions
200+
built from source.
201+
For example, if the version of Node.js is v8.0.0-pre:
202+
203+
```bash
204+
nvm use 8
205+
```
206+
207+
Once the official release is out you will want to uninstall the version built
208+
from source:
209+
210+
```bash
211+
nvm uninstall 8
212+
```
213+
214+
## nvs
215+
216+
#### Windows
217+
The `nvs` version manager is cross-platform and can be used on Windows, macOS, and Unix-like systems
218+
219+
To install `nvs` on Windows go to the [release page](https://github.com/jasongin/nvs/releases) here and download the MSI installer file of the latest release.
220+
221+
You can also use `chocolatey` to install it:
222+
223+
```bash
224+
choco install nvs
225+
```
226+
227+
#### macOS,UnixLike
228+
You can find the documentation regarding the installation steps of `nvs` in macOS/Unix-like systems [here](https://github.com/jasongin/nvs/blob/master/doc/SETUP.md#mac-linux)
229+
230+
#### Usage
231+
After this you can use `nvs` to switch between different versions of node.
232+
233+
To add the latest version of node:
234+
235+
```bash
236+
nvs add latest
237+
```
238+
239+
Or to add the latest LTS version of node:
240+
241+
```bash
242+
nvs add lts
243+
```
244+
245+
Then run the `nvs use` command to add a version of node to your `PATH` for the current shell:
246+
247+
```bash
248+
$ nvs use lts
249+
PATH -= %LOCALAPPDATA%\nvs\default
250+
PATH += %LOCALAPPDATA%\nvs\node\14.17.0\x64
251+
```
252+
253+
To add it to `PATH` permanently, use `nvs link`:
254+
255+
```bash
256+
nvs link lts
257+
```
258+
259+
## OpenBSD
260+
261+
Node.js is available through the ports system.
262+
263+
```bash
264+
/usr/ports/lang/node
265+
```
266+
267+
Using [pkg_add](https://man.openbsd.org/OpenBSD-current/man1/pkg_add.1) on OpenBSD:
268+
269+
```bash
270+
pkg_add node
271+
```
272+
273+
## openSUSE and SLE
274+
275+
Node.js is available in the main repositories under the following packages:
276+
277+
* **openSUSE Leap 15.2**: `nodejs10`, `nodejs12`, `nodejs14`
278+
* **openSUSE Tumbleweed**: `nodejs16`
279+
* **SUSE Linux Enterprise Server (SLES) 12**: `nodejs10`, `nodejs12`, and `nodejs14`
280+
(The "Web and Scripting Module" must be [enabled](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12-SP5/#intro-modulesExtensionsRelated).)
281+
* **SUSE Linux Enterprise Server (SLES) 15 SP2**: `nodejs10`, `nodejs12`, and `nodejs14`
282+
(The "Web and Scripting Module" must be [enabled](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15/#Intro.Module).)
283+
284+
For example, to install Node.js 14.x on openSUSE Leap 15.2, run the following as root:
285+
286+
```bash
287+
zypper install nodejs14
288+
```
289+
290+
Different major versions of Node can be installed and used concurrently.
291+
292+
## SmartOS and illumos
293+
294+
SmartOS images come with pkgsrc pre-installed. On other illumos distributions, first install **[pkgsrc](https://pkgsrc.joyent.com/install-on-illumos/)**, then you may install the binary package as normal:
295+
296+
```bash
297+
pkgin -y install nodejs
298+
```
299+
300+
Or build manually from pkgsrc:
301+
302+
```bash
303+
cd pkgsrc/lang/nodejs && bmake install
304+
```
305+
306+
## Snap
307+
308+
[Node.js snaps](https://github.com/nodejs/snap) are available as [`node`](https://snapcraft.io/node) on the Snap store.
309+
310+
## Solus
311+
312+
Solus provides Node.js in its main repository.
313+
314+
```bash
315+
sudo eopkg install nodejs
316+
```
317+
318+
## Void Linux
319+
320+
Void Linux ships Node.js stable in the main repository.
321+
322+
```bash
323+
xbps-install -Sy nodejs
324+
```
325+
326+
## Windows
327+
328+
Download the [Windows Installer](https://nodejs.org/en/#home-downloadhead) directly from the [nodejs.org](https://nodejs.org/) web site.
329+
330+
### Alternatives
331+
332+
Using **[Chocolatey](https://chocolatey.org/)**:
333+
334+
```bash
335+
cinst nodejs
336+
# or for full install with npm
337+
cinst nodejs.install
338+
```
339+
340+
Using **[Scoop](https://scoop.sh/)**:
341+
342+
```bash
343+
scoop install nodejs
344+
```
345+
346+
## z/OS
347+
348+
IBM&reg; SDK for Node.js - z/OS&reg; is available in two installation formats,
349+
SMP/E and PAX. Select the installation format that applies to you:
350+
* [Installing and configuring SMP/E edition of Node.js on z/OS](https://www.ibm.com/support/knowledgecenter/SSTRRS_14.0.0/com.ibm.nodejs.zos.v14.doc/smpe.htm)
351+
* [Installing and configuring PAX edition of Node.js on z/OS](https://www.ibm.com/support/knowledgecenter/SSTRRS_14.0.0/com.ibm.nodejs.zos.v14.doc/paxz.htm)

gatsby-config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ module.exports = {
7676
path: `${__dirname}/content/about`,
7777
},
7878
},
79+
{
80+
resolve: 'gatsby-source-filesystem',
81+
options: {
82+
name: 'download',
83+
path: `${__dirname}/content/download`,
84+
},
85+
},
7986
{
8087
resolve: `gatsby-plugin-mdx`,
8188
options: {

gatsby-node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ exports.createPages = ({ graphql, actions }) => {
3232
"about"
3333
"governance"
3434
"security"
35+
"package-manager"
3536
]
3637
}
3738
}

src/components/InstallTabs/LinuxPanel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ g++ libgcc linux-headers grep util-linux binutils findutils"
3030
{/* TODO when the new docs page is ready link to that page. */}
3131
<a
3232
className="install__docs-button"
33-
href="https://nodejs.org/en/download/package-manager/#nvm"
33+
href="https://nodejs.dev/download/package-manager/#nvm"
3434
target="_blank"
3535
rel="noopener noreferrer"
3636
>

src/components/InstallTabs/MacOSPanel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const MacOSPanel = (): JSX.Element => {
1919
<br />
2020
<a
2121
className="install__docs-button"
22-
href="https://nodejs.org/en/download/package-manager/#nvm"
22+
href="https://nodejs.dev/download/package-manager/#nvm"
2323
target="_blank"
2424
rel="noopener noreferrer"
2525
>

0 commit comments

Comments
 (0)