codekingpro/portable-devtools
114k
1<!DOCTYPE html><html><head>
2<meta charset="utf-8">
3<title>npm</title>
4<style>
5body {
6 background-color: #ffffff;
7 color: #24292e;
8
9 margin: 0;
10
11 line-height: 1.5;
12
13 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
14}
15#rainbar {
16 height: 10px;
17 background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
18}
19
20a {
21 text-decoration: none;
22 color: #0366d6;
23}
24a:hover {
25 text-decoration: underline;
26}
27
28pre {
29 margin: 1em 0px;
30 padding: 1em;
31 border: solid 1px #e1e4e8;
32 border-radius: 6px;
33
34 display: block;
35 overflow: auto;
36
37 white-space: pre;
38
39 background-color: #f6f8fa;
40 color: #393a34;
41}
42code {
43 font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
44 font-size: 85%;
45 padding: 0.2em 0.4em;
46 background-color: #f6f8fa;
47 color: #393a34;
48}
49pre > code {
50 padding: 0;
51 background-color: inherit;
52 color: inherit;
53}
54h1, h2, h3 {
55 font-weight: 600;
56}
57
58#logobar {
59 background-color: #333333;
60 margin: 0 auto;
61 padding: 1em 4em;
62}
63#logobar .logo {
64 float: left;
65}
66#logobar .title {
67 font-weight: 600;
68 color: #dddddd;
69 float: left;
70 margin: 5px 0 0 1em;
71}
72#logobar:after {
73 content: "";
74 display: block;
75 clear: both;
76}
77
78#content {
79 margin: 0 auto;
80 padding: 0 4em;
81}
82
83#table_of_contents > h2 {
84 font-size: 1.17em;
85}
86#table_of_contents ul:first-child {
87 border: solid 1px #e1e4e8;
88 border-radius: 6px;
89 padding: 1em;
90 background-color: #f6f8fa;
91 color: #393a34;
92}
93#table_of_contents ul {
94 list-style-type: none;
95 padding-left: 1.5em;
96}
97#table_of_contents li {
98 font-size: 0.9em;
99}
100#table_of_contents li a {
101 color: #000000;
102}
103
104header.title {
105 border-bottom: solid 1px #e1e4e8;
106}
107header.title > h1 {
108 margin-bottom: 0.25em;
109}
110header.title > .description {
111 display: block;
112 margin-bottom: 0.5em;
113 line-height: 1;
114}
115
116header.title .version {
117 font-size: 0.8em;
118 color: #666666;
119}
120
121footer#edit {
122 border-top: solid 1px #e1e4e8;
123 margin: 3em 0 4em 0;
124 padding-top: 2em;
125}
126
127table {
128 width: 100%;
129 margin: 1em 0;
130 border-radius: 6px;
131 border: 1px solid #e1e4e8;
132 overflow: hidden;
133 border-collapse: separate;
134 border-spacing: 0;
135}
136
137table thead {
138 background-color: #f6f8fa;
139}
140
141table tbody {
142 background-color: #ffffff;
143}
144
145table th,
146table td {
147 padding: 0.75em;
148 text-align: left;
149 border-right: 1px solid #e1e4e8;
150 border-bottom: 1px solid #e1e4e8;
151}
152
153table th:last-child,
154table td:last-child {
155 border-right: none;
156}
157
158table tbody tr:last-child td {
159 border-bottom: none;
160}
161
162table th {
163 font-weight: 600;
164 background-color: #f6f8fa;
165}
166
167table code {
168 white-space: nowrap;
169}
170
171</style>
172</head>
173<body>
174<div id="banner">
175<div id="rainbar"></div>
176<div id="logobar">
177<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
178<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
179<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
180</svg>
181<div class="title">
182npm command-line interface
183</div>
184</div>
185</div>
186
187<section id="content">
188<header class="title">
189<h1 id="----npm----11130">
190 <span>npm</span>
191 <span class="version">@11.13.0</span>
192</h1>
193<span class="description">javascript package manager</span>
194</header>
195
196<section id="table_of_contents">
197<h2 id="table-of-contents">Table of contents</h2>
198<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#version">Version</a></li><li><a href="#description">Description</a></li><li><a href="#important">Important</a></li><li><a href="#introduction">Introduction</a></li><li><a href="#dependencies">Dependencies</a></li><li><a href="#directories">Directories</a></li><li><a href="#developer-usage">Developer Usage</a></li><ul><li><a href="#configuration">Configuration</a></li></ul><li><a href="#contributions">Contributions</a></li><li><a href="#bugs">Bugs</a></li><li><a href="#feature-requests">Feature Requests</a></li><li><a href="#see-also">See Also</a></li></ul></div>
199</section>
200
201<div id="_content"><h3 id="synopsis">Synopsis</h3>
202<pre><code class="language-bash">npm
203</code></pre>
204<p>Note: This command is unaware of workspaces.</p>
205<h3 id="version">Version</h3>
206<p>11.13.0</p>
207<h3 id="description">Description</h3>
208<p>npm is the package manager for the Node JavaScript platform.
209It puts modules in place so that node can find them, and manages dependency conflicts intelligently.</p>
210<p>It is extremely configurable to support a variety of use cases.
211Most commonly, you use it to publish, discover, install, and develop node programs.</p>
212<p>Run <code>npm help</code> to get a list of available commands.</p>
213<h3 id="important">Important</h3>
214<p>npm comes preconfigured to use npm's public registry at <a href="https://registry.npmjs.org">https://registry.npmjs.org</a> by default.
215Use of the npm public registry is subject to terms of use available at <a href="https://docs.npmjs.com/policies/terms">https://docs.npmjs.com/policies/terms</a>.</p>
216<p>You can configure npm to use any compatible registry you like, and even run your own registry.
217Use of someone else's registry is governed by their terms of use.</p>
218<h3 id="introduction">Introduction</h3>
219<p>You probably got npm because you want to install stuff.</p>
220<p>The very first thing you will most likely want to run in any node program is <code>npm install</code> to install its dependencies.</p>
221<p>You can also run <code>npm install blerg</code> to install the latest version of "blerg". Check out <a href="../commands/npm-install.html"><code>npm install</code></a> for more info.
222It can do a lot of stuff.</p>
223<p>Use the <code>npm search</code> command to show everything that's available in the public registry.
224Use <code>npm ls</code> to show everything you've installed.</p>
225<h3 id="dependencies">Dependencies</h3>
226<p>If a package lists a dependency using a git URL, npm will install that dependency using the <a href="https://github.com/git-guides/install-git"><code>git</code></a> command and will generate an error if it is not installed.</p>
227<p>If one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use <a href="https://github.com/nodejs/node-gyp">node-gyp</a> for that task.
228For a Unix system, <a href="https://github.com/nodejs/node-gyp">node-gyp</a> needs Python, make and a buildchain like GCC. On Windows, Python and Microsoft Visual Studio C++ are needed.
229For more information visit <a href="https://github.com/nodejs/node-gyp">the node-gyp repository</a> and the <a href="https://github.com/nodejs/node-gyp/wiki">node-gyp Wiki</a>.</p>
230<h3 id="directories">Directories</h3>
231<p>See <a href="../configuring-npm/folders.html"><code>folders</code></a> to learn about where npm puts stuff.</p>
232<p>In particular, npm has two modes of operation:</p>
233<ul>
234<li>local mode:
235npm installs packages into the current project directory, which defaults to the current working directory.
236Packages install to <code>./node_modules</code>, and bins to <code>./node_modules/.bin</code>.</li>
237<li>global mode:
238npm installs packages into the install prefix at <code>$NPM_CONFIG_PREFIX/lib/node_modules</code> and bins to <code>$NPM_CONFIG_PREFIX/bin</code>.</li>
239</ul>
240<p>Local mode is the default.
241Use <code>-g</code> or <code>--global</code> on any command to run in global mode instead.</p>
242<h3 id="developer-usage">Developer Usage</h3>
243<p>If you're using npm to develop and publish your code, check out the following help topics:</p>
244<ul>
245<li>json:
246Make a package.json file.
247See <a href="../configuring-npm/package-json.html"><code>package.json</code></a>.</li>
248<li>link:
249Links your current working code into Node's path, so that you don't have to reinstall every time you make a change.
250Use <a href="../commands/npm-link.html"><code>npm link</code></a> to do this.</li>
251<li>install:
252It's a good idea to install things if you don't need the symbolic link.
253Especially, installing other peoples code from the registry is done via <a href="../commands/npm-install.html"><code>npm install</code></a></li>
254<li>adduser:
255Create an account or log in.
256When you do this, npm will store credentials in the user config file.</li>
257<li>publish:
258Use the <a href="../commands/npm-publish.html"><code>npm publish</code></a> command to upload your code to the registry.</li>
259</ul>
260<h4 id="configuration">Configuration</h4>
261<p>npm is extremely configurable.
262It reads its configuration options from 5 places.</p>
263<ul>
264<li>Command line switches:
265Set a config with <code>--key val</code>.
266All keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing).
267If you do not provide a value (<code>--key</code>) then the option is set to boolean <code>true</code>.</li>
268<li>Environment Variables:
269Set any config by prefixing the name in an environment variable with <code>NPM_CONFIG_</code>.
270For example, <code>export NPM_CONFIG_KEY=val</code>.</li>
271<li>User Configs:
272The file at <code>$HOME/.npmrc</code> is an ini-formatted list of configs.
273If present, it is parsed.
274If the <code>userconfig</code> option is set in the cli or env, that file will be used instead.</li>
275<li>Global Configs:
276The file found at <code>./etc/npmrc</code> (relative to the global prefix will be parsed if it is found.
277See <a href="../commands/npm-prefix.html"><code>npm prefix</code></a> for more info on the global prefix.
278If the <code>globalconfig</code> option is set in the cli, env, or user config, then that file is parsed instead.</li>
279<li>Defaults:
280npm's default configuration options are defined in <code>lib/utils/config/definitions.js</code>.
281These must not be changed.</li>
282</ul>
283<p>See <a href="../using-npm/config.html"><code>config</code></a> for much, much, more information.</p>
284<h3 id="contributions">Contributions</h3>
285<p>Patches welcome!</p>
286<p>If you would like to help, but don't know what to work on, read the <a href="https://github.com/npm/cli/blob/latest/CONTRIBUTING.md">contributing guidelines</a> and check the issues list.</p>
287<h3 id="bugs">Bugs</h3>
288<p>When you find issues, please report them:
289<a href="https://github.com/npm/cli/issues">https://github.com/npm/cli/issues</a></p>
290<p>Please be sure to follow the template and bug reporting guidelines.</p>
291<h3 id="feature-requests">Feature Requests</h3>
292<p>Discuss new feature ideas on our discussion forum:</p>
293<ul>
294<li><a href="https://github.com/orgs/community/discussions/categories/npm">https://github.com/orgs/community/discussions/categories/npm</a></li>
295</ul>
296<p>Or suggest formal RFC proposals:</p>
297<ul>
298<li><a href="https://github.com/npm/rfcs">https://github.com/npm/rfcs</a></li>
299</ul>
300<h3 id="see-also">See Also</h3>
301<ul>
302<li><a href="../commands/npm-help.html">npm help</a></li>
303<li><a href="../configuring-npm/package-json.html">package.json</a></li>
304<li><a href="../configuring-npm/npmrc.html">npmrc</a></li>
305<li><a href="../commands/npm-config.html">npm config</a></li>
306<li><a href="../commands/npm-install.html">npm install</a></li>
307<li><a href="../commands/npm-prefix.html">npm prefix</a></li>
308<li><a href="../commands/npm-publish.html">npm publish</a></li>
309</ul></div>
310
311<footer id="edit">
312<a href="https://github.com/npm/cli/edit/latest/docs/lib/content/commands/npm.md">
313<svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
314<path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
315</svg>
316Edit this page on GitHub
317</a>
318</footer>
319</section>
320
321
322
323</body></html>