PageSourceSearch

https://pnpm.io/installation

html pnpm.io collected 2026-10-01 07:29:40 UTC 14,106 bytes, 241 lines download raw bytes

1<!doctype html>
2<html lang="en">
3  <head><!-- first-paint -->
3<script>(function(){var t;try{t=localStorage.getItem("theme")}catch(e){}if(t!=='light'&&t!=='dark')t=window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';document.documentElement.setAttribute('data-theme',t)})()</script>
3<link rel="preconnect" href="https://fonts.googleapis.com" /><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" /><style>body{font-family:var(--typography-font-family,system-ui,sans-serif);background:var(--colors-surface-background,#fff);color:var(--colors-text-primary,#212121);margin:0}.docs-prerendered{box-sizing:border-box;overflow-wrap:break-word;max-width:860px;margin:0 auto;padding:88px 24px 48px;line-height:1.6}.docs-prerendered h1{margin:0 0 24px;font-size:36px;line-height:1.2}.docs-prerendered h2{margin:48px 0 16px;font-size:30px;line-height:1.2}.docs-prerendered h3{margin:32px 0 12px;font-size:24px;line-height:1.2}.docs-prerendered a{color:var(--colors-text-link,#f69220)}.docs-prerendered .hash-link{display:none}.docs-prerendered img{max-width:100%;height:auto}.docs-prerendered pre{background:var(--colors-surface-tertiary,#f8f9fa);border-radius:8px;padding:16px;overflow-x:auto}.docs-prerendered code{font-size:.9em}.docs-prerendered table{border-collapse:collapse;display:block;overflow-x:auto}.docs-prerendered th,.docs-prerendered td{border:1px solid var(--colors-border-default,#e0e0e0);padding:8px 12px}.docs-prerendered article+article{margin-top:48px}</style>
4    <meta charset="UTF-8" />
5    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6    <title>Installation | pnpm</title>
7    <meta name="description" content="pnpm 12 is a native executable and does not require Node.js after it is installed. Installing it through npm requires Node.js 22.13 or newer." />
8    <meta name="theme-color" content="#f69220" />
9    <link rel="icon" href="/img/favicon.png" />
10    <link rel="alternate" type="application/rss+xml" title="pnpm Blog RSS Feed" href="/blog/rss.xml" />
11    <link rel="alternate" type="application/atom+xml" title="pnpm Blog Atom Feed" href="/blog/atom.xml" />
12
13    <meta property="og:type" content="website" />
14    <meta property="og:site_name" content="pnpm" />
15    <meta property="og:title" content="Installation | pnpm" />
16    <meta property="og:description" content="pnpm 12 is a native executable and does not require Node.js after it is installed. Installing it through npm requires Node.js 22.13 or newer." />
17    <meta property="og:image" content="https://pnpm.io/img/ogimage.png" />
18
19    <meta name="twitter:card" content="summary_large_image" />
20    <meta name="twitter:site" content="@pnpmjs" />
21    <meta name="twitter:title" content="Installation | pnpm" />
22    <meta name="twitter:description" content="pnpm 12 is a native executable and does not require Node.js after it is installed. Installing it through npm requires Node.js 22.13 or newer." />
23    <meta name="twitter:image" content="https://pnpm.io/img/ogimage.png" />
24
25    
25<script type="module" crossorigin src="/assets/index-CjpiBuHV.js"></script>
25
26    <link rel="stylesheet" crossorigin href="/assets/index-gKrm_uHA.css">
27  <link rel="canonical" href="https://pnpm.io/installation" />
28    <meta property="og:url" content="https://pnpm.io/installation" />
29    <link rel="alternate" hreflang="en" href="https://pnpm.io/installation" />
30    <link rel="alternate" hreflang="it" href="https://pnpm.io/it/installation" />
31    <link rel="alternate" hreflang="zh" href="https://pnpm.io/zh/installation" />
32    <link rel="alternate" hreflang="ja" href="https://pnpm.io/ja/installation" />
33    <link rel="alternate" hreflang="ko" href="https://pnpm.io/ko/installation" />
34    <link rel="alternate" hreflang="pt" href="https://pnpm.io/pt/installation" />
35    <link rel="alternate" hreflang="zh-TW" href="https://pnpm.io/zh-TW/installation" />
36    <link rel="alternate" hreflang="ru" href="https://pnpm.io/ru/installation" />
37    <link rel="alternate" hreflang="uk" href="https://pnpm.io/uk/installation" />
38    <link rel="alternate" hreflang="fr" href="https://pnpm.io/fr/installation" />
39    <link rel="alternate" hreflang="tr" href="https://pnpm.io/tr/installation" />
40    <link rel="alternate" hreflang="es" href="https://pnpm.io/es/installation" />
41    <link rel="alternate" hreflang="id" href="https://pnpm.io/id/installation" />
42    <link rel="alternate" hreflang="x-default" href="https://pnpm.io/installation" />
43    <meta name="docsearch:language" content="en" />
44    <meta name="docsearch:version" content="12.x" />
45    <meta name="docsearch:docusaurus_tag" content="docs-default-12.x" />
46  </head>
47  <body>
48    <div id="root"><main class="docs-prerendered"><article><h1>Installation</h1><h2 id="prerequisites">Prerequisites<a class="hash-link" href="#prerequisites" aria-label="Direct link to Prerequisites">#</a></h2>
49<p>pnpm 12 is a native executable and does not require Node.js after it is installed. Installing it through npm requires Node.js 22.13 or newer.</p>
50<p>pnpm 12 is the current release line — the <code>latest</code> tag on npm points at it, so the commands below install pnpm 12 without naming a version.</p>
51<h3 id="supported-platforms">Supported platforms<a class="hash-link" href="#supported-platforms" aria-label="Direct link to Supported platforms">#</a></h3>
52<p>pnpm 12 ships a prebuilt binary for each of these targets:</p>
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86<div class="table-wrapper"><table><thead><tr><th>Operating system</th><th>Architectures</th></tr></thead><tbody><tr><td>Linux (glibc)</td><td>x64, arm64, riscv64, ppc64le, s390x</td></tr><tr><td>Linux (musl)</td><td>x64, arm64</td></tr><tr><td>macOS</td><td>arm64, x64</td></tr><tr><td>Windows</td><td>x64, arm64</td></tr><tr><td>FreeBSD</td><td>x64</td></tr><tr><td>Android</td><td>arm64, x64</td></tr></tbody></table></div>
87<p>FreeBSD, ppc64le, s390x, RISC-V, and Android were added in v12.4.0. On a target with no binary, install the JavaScript <a href="https://www.npmjs.com/package/pnpm/v/11">pnpm 11</a> instead.</p>
88<h2 id="using-pnpm">Using pnpm<a class="hash-link" href="#using-pnpm" aria-label="Direct link to Using pnpm">#</a></h2>
89<p>If you already have pnpm v11.10.0 or newer, update directly to pnpm 12:</p>
90<pre><code class="hljs language-sh">pnpm self-update
91</code></pre>
92<p>Inside a project that pins pnpm through the <code>packageManager</code> field, <a href="/cli/self-update"><code>self-update</code></a> only updates that pin instead of installing pnpm globally.</p>
93<h2 id="using-a-standalone-script">Using a standalone script<a class="hash-link" href="#using-a-standalone-script" aria-label="Direct link to Using a standalone script">#</a></h2>
94<p>You may install pnpm even if you don't have Node.js installed, using the following scripts.</p>
95<h3 id="on-windows">On Windows<a class="hash-link" href="#on-windows" aria-label="Direct link to On Windows">#</a></h3>
96<div class="admonition admonition-warning"><p class="admonition-title">Warning</p>
97<p>Sometimes, Windows Defender may block our executable if you install pnpm this way.</p>
98<p>Due to this issue, we currently recommend installing pnpm using <a href="#using-npm">npm</a> on Windows.</p>
99</div>
100<p>Using PowerShell:</p>
101<pre><code class="hljs language-powershell"><span class="hljs-built_in">Invoke-WebRequest</span> https://get.pnpm.io/install.ps1 <span class="hljs-literal">-UseBasicParsing</span> | <span class="hljs-built_in">Invoke-Expression</span>
102</code></pre>
103<p>On Windows, Microsoft Defender can significantly slow down installation of packages. You can add pnpm to Microsoft Defender's list
104of excluded folders in a PowerShell window with administrator rights by executing:</p>
105<pre><code class="hljs language-powershell"><span class="hljs-built_in">Add-MpPreference</span> <span class="hljs-literal">-ExclusionPath</span> <span class="hljs-variable">$</span>(pnpm store path)
106</code></pre>
107<h3 id="on-posix-systems">
107On POSIX systems<a class="hash-link" href="#on-posix-systems" aria-label="Direct link to On POSIX systems">#</a></h3>
108<pre><code class="hljs language-sh">curl -fsSL https://get.pnpm.io/install.sh | sh -
109</code></pre>
110<p>If you don't have curl installed, you would like to use wget:</p>
111<pre><code class="hljs language-sh">wget -qO- https://get.pnpm.io/install.sh | sh -
112</code></pre>
113<div class="admonition admonition-tip"><p class="admonition-title">Tip</p>
114<p>You may use the <a href="/cli/runtime">pnpm runtime</a> command then to install Node.js.</p>
115</div>
116<h3 id="in-a-docker-container">In a Docker container<a class="hash-link" href="#in-a-docker-container" aria-label="Direct link to In a Docker container">#</a></h3>
117<pre><code class="hljs language-sh"><span class="hljs-comment"># bash</span>
118wget -qO- https://get.pnpm.io/install.sh | <span class="hljs-built_in">env</span> ENV=<span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.bashrc"</span> SHELL=<span class="hljs-string">"<span class="hljs-subst">$(which bash)</span>"</span> bash -
119<span class="hljs-comment"># sh</span>
120wget -qO- https://get.pnpm.io/install.sh | <span class="hljs-built_in">env</span> ENV=<span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.shrc"</span> SHELL=<span class="hljs-string">"<span class="hljs-subst">$(which sh)</span>"</span> sh -
121<span class="hljs-comment"># dash</span>
122wget -qO- https://get.pnpm.io/install.sh | <span class="hljs-built_in">env</span> ENV=<span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.dashrc"</span> SHELL=<span class="hljs-string">"<span class="hljs-subst">$(which dash)</span>"</span> dash -
123</code></pre>
124<h3 id="installing-a-specific-version">Installing a specific version<a class="hash-link" href="#installing-a-specific-version" aria-label="Direct link to Installing a specific version">#</a></h3>
125<p>Prior to running the install script, you may optionally set an env variable <code>PNPM_VERSION</code> to install a specific version of pnpm:</p>
126<pre><code class="hljs language-sh">curl -fsSL https://get.pnpm.io/install.sh | <span class="hljs-built_in">env</span> PNPM_VERSION=&#x3C;version> sh -
127</code></pre>
128<h2 id="using-npm">Using npm<a class="hash-link" href="#using-npm" aria-label="Direct link to Using npm">#</a></h2>
129<pre><code class="hljs language-sh">npx get-pnpm
130</code></pre>
131<p>Node.js 22.13 or newer is needed to run this installer, but not to run pnpm afterwards.<
131/p>
132<div class="admonition admonition-tip"><p class="admonition-title">Tip</p>
133<p>Do you wanna use pnpm on CI servers? See: <a href="/continuous-integration">Continuous Integration</a>.</p>
134</div>
135<h2 id="compatibility">Compatibility<a class="hash-link" href="#compatibility" aria-label="Direct link to Compatibility">#</a></h2>
136<p>Here is a list of past pnpm versions with respective Node.js version support.</p>
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206<div class="table-wrapper"><table><thead><tr><th>Node.js</th><th>pnpm 8</th><th>pnpm 9</th><th>pnpm 10</th><th>pnpm 11</th><th>pnpm 12</th></tr></thead><tbody><tr><td>Node.js 14</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td></tr><tr><td>Node.js 16</td><td>✔️</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td></tr><tr><td>Node.js 18</td><td>✔️</td><td>✔️</td><td>✔️</td><td>❌</td><td>✔️</td></tr><tr><td>Node.js 20</td><td>✔️</td><td>✔️</td><td>✔️</td><td>❌</td><td>✔️</td></tr><tr><td>Node.js 22</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>Node.js 24</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>Node.js 26</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr></tbody></table></div>
207<p>pnpm 12 only needs Node.js when it is installed from npm; the version installed by the standalone script runs without Node.js.</p>
208<h2 id="troubleshooting">Troubleshooting<a class="hash-link" href="#troubleshooting" aria-label="Direct link to Troubleshooting">#</a></h2>
209<p>If pnpm is broken and you cannot fix it by reinstalling, you might need to remove it manually from the PATH.</p>
210<p>Let's assume you have the following error when running <code>pnpm install</code>:</p>
211<pre><code>C:\src>pnpm install
212internal/modules/cjs/loader.js:883
213  throw err;
214  ^
215
216
217
218Error: Cannot find module 'C:\Users\Bence\AppData\Roaming\npm\pnpm-global\4\node_modules\pnpm\bin\pnpm.js'
219←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
220←[90m    at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
221←[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
222←[90m    at internal/main/run_main_module.js:17:47←[39m {
223  code: ←[32m'MODULE_NOT_FOUND'←[39m,
224  requireStack: []
225}
226</code></pre>
227<p>First, try to find the location of pnpm by running: <code>which pnpm</code>. If you're on Windows, run <code>where.exe pnpm.*</code>.
228You'll get the location of the pnpm command, for instance:</p>
229<pre><code>$ which pnpm
230/c/Program Files/nodejs/pnpm
231</code></pre>
232<p>Now that you know where the pnpm CLI is, open that directory and remove any pnpm-related files (<code>pnpm.cmd</code>, <code>pnpx.cmd</code>, <code>pnpm</code>, etc).
233Once done, install pnpm again and it should work as expected.</p>
234<h2 id="updating-pnpm">Updating pnpm<a class="hash-link" href="#updating-pnpm" aria-label="Direct link to Updating pnpm">#</a></h2>
235<p>To update pnpm, run the <a href="/cli/self-update"><code>self-update</code></a> command:</p>
236<pre><code>pnpm self-update
237</code></pre>
238<h2 id="uninstalling-pnpm">Uninstalling pnpm<a class="hash-link" href="#uninstalling-pnpm" aria-label="Direct link to Uninstalling pnpm">#</a></h2>
239<p>If you need to remove the pnpm CLI from your system and any files it has written to your disk, see <a href="/uninstall">Uninstalling pnpm</a>.</p></article></main></div>
240  </body>
241</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.