4 <meta http-equiv="content-type" value="text/html;utf-8">
5 <link rel="stylesheet" type="text/css" href="../../static/style.css">
9 <h1><a href="../cli/npm.html">npm</a></h1> <p>node package manager</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm <command> [args]</code></pre>
15 <h2 id="VERSION">VERSION</h2>
19 <h2 id="DESCRIPTION">DESCRIPTION</h2>
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>
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
29 <p>Run <code>npm help</code> to get a list of available commands.</p>
31 <h2 id="INTRODUCTION">INTRODUCTION</h2>
33 <p>You probably got npm because you want to install stuff.</p>
35 <p>Use <code>npm install blerg</code> to install the latest version of "blerg". 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>
38 <p>Use the <code>npm search</code> command to show everything that's available.
39 Use <code>npm ls</code> to show everything you've installed.</p>
41 <h2 id="DIRECTORIES">DIRECTORIES</h2>
43 <p>See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code> to learn about where npm puts stuff.</p>
45 <p>In particular, npm has two modes of operation:</p>
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>
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>
55 <h2 id="DEVELOPER-USAGE">DEVELOPER USAGE</h2>
57 <p>If you're using npm to develop and publish your code, check out the
58 following help topics:</p>
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's path, so that you
63 don't have to reinstall every time you make a change. Use
64 <code>npm link</code> to do this.</li><li>install:
65 It's a good idea to install things if you don'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>
72 <h2 id="CONFIGURATION">CONFIGURATION</h2>
74 <p>npm is extremely configurable. It reads its configuration options from
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'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's default configuration options are defined in
87 lib/utils/config-defs.js. These must not be changed.</li></ul>
89 <p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> for much much more information.</p>
91 <h2 id="CONTRIBUTIONS">CONTRIBUTIONS</h2>
93 <p>Patches welcome!</p>
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'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 "doc" folder. (Don't worry about generating the man page.)</li></ul>
101 <p>Contributors are listed in npm's <code>package.json</code> file. You can view them
102 easily by doing <code>npm view npm contributors</code>.</p>
104 <p>If you would like to contribute, but don't know what to work on, check
105 the issues list or ask on the mailing list.</p>
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>
109 <h2 id="BUGS">BUGS</h2>
111 <p>When you find issues, please report them:</p>
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>
117 <p>Be sure to include <em>all</em> of the output from the npm command that didn't work
118 as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
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>
123 <h2 id="AUTHOR">AUTHOR</h2>
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>
130 <h2 id="SEE-ALSO">SEE ALSO</h2>
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>
134 <p id="footer">npm — npm@1.3.17</p>
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]/)
145 , toc = document.createElement("ul")
146 toc.innerHTML = els.map(function (el) {
147 var i = el.tagName.charAt(1)
157 out += "<li><a href='#" + el.id + "'>" +
158 ( el.innerText || el.text || el.innerHTML)
163 document.body.appendChild(toc)