npm: Upgrade to 1.3.19
[platform/upstream/nodejs.git] / deps / npm / html / doc / cli / npm.html
1 <!doctype html>
2 <html>
3   <title>npm</title>
4   <meta http-equiv="content-type" value="text/html;utf-8">
5   <link rel="stylesheet" type="text/css" href="../../static/style.css">
6
7   <body>
8     <div id="wrapper">
9 <h1><a href="../cli/npm.html">npm</a></h1> <p>node package manager</p>
10
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
12
13 <pre><code>npm &lt;command&gt; [args]</code></pre>
14
15 <h2 id="VERSION">VERSION</h2>
16
17 <p>1.3.19</p>
18
19 <h2 id="DESCRIPTION">DESCRIPTION</h2>
20
21 <p>npm is the package manager for the Node JavaScript platform.  It puts
22 modules in place so that node can find them, and manages dependency
23 conflicts intelligently.</p>
24
25 <p>It is extremely configurable to support a wide variety of use cases.
26 Most commonly, it is used to publish, discover, install, and develop node
27 programs.</p>
28
29 <p>Run <code>npm help</code> to get a list of available commands.</p>
30
31 <h2 id="INTRODUCTION">INTRODUCTION</h2>
32
33 <p>You probably got npm because you want to install stuff.</p>
34
35 <p>Use <code>npm install blerg</code> to install the latest version of &quot;blerg&quot;.  Check out
36 <code><a href="../cli/npm-install.html">npm-install(1)</a></code> for more info.  It can do a lot of stuff.</p>
37
38 <p>Use the <code>npm search</code> command to show everything that&#39;s available.
39 Use <code>npm ls</code> to show everything you&#39;ve installed.</p>
40
41 <h2 id="DIRECTORIES">DIRECTORIES</h2>
42
43 <p>See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code> to learn about where npm puts stuff.</p>
44
45 <p>In particular, npm has two modes of operation:</p>
46
47 <ul><li>global mode:<br />npm installs packages into the install prefix at
48 <code>prefix/lib/node_modules</code> and bins are installed in <code>prefix/bin</code>.</li><li>local mode:<br />npm installs packages into the current project directory, which
49 defaults to the current working directory.  Packages are installed to
50 <code>./node_modules</code>, and bins are installed to <code>./node_modules/.bin</code>.</li></ul>
51
52 <p>Local mode is the default.  Use <code>--global</code> or <code>-g</code> on any command to
53 operate in global mode instead.</p>
54
55 <h2 id="DEVELOPER-USAGE">DEVELOPER USAGE</h2>
56
57 <p>If you&#39;re using npm to develop and publish your code, check out the
58 following help topics:</p>
59
60 <ul><li>json:
61 Make a package.json file.  See <code><a href="../files/package.json.html">package.json(5)</a></code>.</li><li>link:
62 For linking your current working code into Node&#39;s path, so that you
63 don&#39;t have to reinstall every time you make a change.  Use
64 <code>npm link</code> to do this.</li><li>install:
65 It&#39;s a good idea to install things if you don&#39;t need the symbolic link.
66 Especially, installing other peoples code from the registry is done via
67 <code>npm install</code></li><li>adduser:
68 Create an account or log in.  Credentials are stored in the
69 user config file.</li><li>publish:
70 Use the <code>npm publish</code> command to upload your code to the registry.</li></ul>
71
72 <h2 id="CONFIGURATION">CONFIGURATION</h2>
73
74 <p>npm is extremely configurable.  It reads its configuration options from
75 5 places.</p>
76
77 <ul><li>Command line switches:<br />Set a config with <code>--key val</code>.  All keys take a value, even if they
78 are booleans (the config parser doesn&#39;t know what the options are at
79 the time of parsing.)  If no value is provided, then the option is set
80 to boolean <code>true</code>.</li><li>Environment Variables:<br />Set any config by prefixing the name in an environment variable with
81 <code>npm_config_</code>.  For example, <code>export npm_config_key=val</code>.</li><li>User Configs:<br />The file at $HOME/.npmrc is an ini-formatted list of configs.  If
82 present, it is parsed.  If the <code>userconfig</code> option is set in the cli
83 or env, then that will be used instead.</li><li>Global Configs:<br />The file found at ../etc/npmrc (from the node executable, by default
84 this resolves to /usr/local/etc/npmrc) will be parsed if it is found.
85 If the <code>globalconfig</code> option is set in the cli, env, or user config,
86 then that file is parsed instead.</li><li>Defaults:<br />npm&#39;s default configuration options are defined in
87 lib/utils/config-defs.js.  These must not be changed.</li></ul>
88
89 <p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> for much much more information.</p>
90
91 <h2 id="CONTRIBUTIONS">CONTRIBUTIONS</h2>
92
93 <p>Patches welcome!</p>
94
95 <ul><li>code:
96 Read through <code><a href="../misc/npm-coding-style.html">npm-coding-style(7)</a></code> if you plan to submit code.
97 You don&#39;t have to agree with it, but you do have to follow it.</li><li>docs:
98 If you find an error in the documentation, edit the appropriate markdown
99 file in the &quot;doc&quot; folder.  (Don&#39;t worry about generating the man page.)</li></ul>
100
101 <p>Contributors are listed in npm&#39;s <code>package.json</code> file.  You can view them
102 easily by doing <code>npm view npm contributors</code>.</p>
103
104 <p>If you would like to contribute, but don&#39;t know what to work on, check
105 the issues list or ask on the mailing list.</p>
106
107 <ul><li><a href="http://github.com/isaacs/npm/issues">http://github.com/isaacs/npm/issues</a></li><li><a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li></ul>
108
109 <h2 id="BUGS">BUGS</h2>
110
111 <p>When you find issues, please report them:</p>
112
113 <ul><li>web:
114 <a href="http://github.com/isaacs/npm/issues">http://github.com/isaacs/npm/issues</a></li><li>email:
115 <a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li></ul>
116
117 <p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
118 as expected.  The <code>npm-debug.log</code> file is also helpful to provide.</p>
119
120 <p>You can also look for isaacs in #node.js on irc://irc.freenode.net.  He
121 will no doubt tell you to put the output in a gist or email.</p>
122
123 <h2 id="AUTHOR">AUTHOR</h2>
124
125 <p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
126 <a href="https://github.com/isaacs/">isaacs</a> ::
127 <a href="http://twitter.com/izs">@izs</a> ::
128 <a href="mailto:i@izs.me">i@izs.me</a></p>
129
130 <h2 id="SEE-ALSO">SEE ALSO</h2>
131
132 <ul><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li><li><a href="../api/npm.html">npm(3)</a></li></ul>
133 </div>
134 <p id="footer">npm &mdash; npm@1.3.19</p>
135 <script>
136 ;(function () {
137 var wrapper = document.getElementById("wrapper")
138 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
139   .filter(function (el) {
140     return el.parentNode === wrapper
141         && el.tagName.match(/H[1-6]/)
142         && el.id
143   })
144 var l = 2
145   , toc = document.createElement("ul")
146 toc.innerHTML = els.map(function (el) {
147   var i = el.tagName.charAt(1)
148     , out = ""
149   while (i > l) {
150     out += "<ul>"
151     l ++
152   }
153   while (i < l) {
154     out += "</ul>"
155     l --
156   }
157   out += "<li><a href='#" + el.id + "'>" +
158     ( el.innerText || el.text || el.innerHTML)
159     + "</a>"
160   return out
161 }).join("\n")
162 toc.id = "toc"
163 document.body.appendChild(toc)
164 })()
165 </script>