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 version of
19 npm and Node.js)
20
21 • Using a Node version manager to install Node.js and npm (Using a
22 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. You can search for them on GitHub
40 ⟨https://github.com/search?q=node+version+man‐
41 ager+archived%3Afalse&type=repositories&ref=advsearch⟩.
42
43 Using a Node installer to install Node.js and npm
44 If you are unable to use a Node version manager, you can use a Node in‐
45 staller to install both Node.js and npm on your system.
46
47 • Node.js installer ⟨https://nodejs.org/en/download/⟩
48
49 • NodeSource installer ⟨https://github.com/nodesource/distributions⟩.
50 If you use Linux, we recommend that you use a NodeSource installer.
51
52
53 OS X or Windows Node installers
54 If you're using OS X or Windows, use one of the installers from the
55 Node.js download page ⟨https://nodejs.org/en/download/⟩. Be sure to in‐
56 stall the version labeled LTS. Other versions have not yet been tested
57 with npm.
58
59 Linux or other operating systems Node installers
60 If you're using Linux or another operating system, use one of the fol‐
61 lowing installers:
62
63 • NodeSource installer ⟨https://github.com/nodesource/distributions⟩
64 (recommended)
65
66 • One of the installers on the Node.js download page
67 ⟨https://nodejs.org/en/download/⟩
68
69
70 Or see this page ⟨https://nodejs.org/en/download/package-manager/⟩ to
71 install npm for Linux in the way many Linux developers prefer.
72
73 Less-common operating systems
74 For more information on installing Node.js on a variety of operating
75 systems, see this page ⟨https://nodejs.org/en/download/package-man‐
76 ager/⟩.
77
78
79
80 November 2023 INSTALL(5)