1INSTALL(5) INSTALL(5)
2
3
4
6 install - Download and install node and npm
7
8 Description
9 To publish and install packages to and from the public npm registry,
10 you must install Node.js and the npm command line interface using ei‐
11 ther a Node version manager or a Node installer. We strongly recommend
12 using a Node version manager to install Node.js and npm. We do not rec‐
13 ommend using a Node installer, since the Node installation process in‐
14 stalls npm in a directory with local permissions and can cause permis‐
15 sions errors when you run npm packages globally.
16
17 Overview
18 • Checking your version of npm and Node.js #checking-your-ver‐
19 sion-of-npm-and-node-js
20
21 • Using a Node version manager to install Node.js and npm #us‐
22 ing-a-node-version-manager-to-install-node-js-and-npm
23
24 • Using a Node installer to install Node.js and npm #using-a-node-in‐
25 staller-to-install-node-js-and-npm
26
27
28 Checking your version of npm and Node.js
29 To see if you already have Node.js and npm installed and check the in‐
30 stalled version, run the following commands:
31
32 node -v
33 npm -v
34
35 Using a Node version manager to install Node.js and npm
36 Node version managers allow you to install and switch between multiple
37 versions of Node.js and npm on your system so you can test your appli‐
38 cations on multiple versions of npm to ensure they work for users on
39 different versions.
40
41 OSX or Linux Node version managers
42 • nvm https://github.com/creationix/nvm
43
44 • n https://github.com/tj/n
45
46
47 Windows Node version managers
48 • nodist https://github.com/marcelklehr/nodist
49
50 • nvm-windows https://github.com/coreybutler/nvm-windows
51
52
53 Using a Node installer to install Node.js and npm
54 If you are unable to use a Node version manager, you can use a Node in‐
55 staller to install both Node.js and npm on your system.
56
57 • Node.js installer https://nodejs.org/en/download/
58
59 • NodeSource installer https://github.com/nodesource/distributions. If
60 you use Linux, we recommend that you use a NodeSource installer.
61
62
63 OS X or Windows Node installers
64 If you're using OS X or Windows, use one of the installers from the
65 Node.js download page https://nodejs.org/en/download/. Be sure to in‐
66 stall the version labeled LTS. Other versions have not yet been tested
67 with npm.
68
69 Linux or other operating systems Node installers
70 If you're using Linux or another operating system, use one of the fol‐
71 lowing installers:
72
73 • NodeSource installer https://github.com/nodesource/distributions
74 (recommended)
75
76 • One of the installers on the Node.js download page
77 https://nodejs.org/en/download/
78
79
80 Or see this page https://nodejs.org/en/download/package-manager/ to in‐
81 stall npm for Linux in the way many Linux developers prefer.
82
83 Less-common operating systems
84 For more information on installing Node.js on a variety of operating
85 systems, see this page https://nodejs.org/en/download/package-manager/.
86
87
88
89 January 2022 INSTALL(5)