6263894d3d064c31dd73c26aa95d5925176a1a80
[platform/upstream/nodejs.git] / deps / npm / html / doc / files / npmrc.html
1 <!doctype html>
2 <html>
3   <title>npmrc</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="../files/npmrc.html">npmrc</a></h1> <p>The npm config files</p>
10
11 <h2 id="DESCRIPTION">DESCRIPTION</h2>
12
13 <p>npm gets its config settings from the command line, environment
14 variables, and <code>npmrc</code> files.</p>
15
16 <p>The <code>npm config</code> command can be used to update and edit the contents
17 of the user and global npmrc files.</p>
18
19 <p>For a list of available configuration options, see <a href="../misc/npm-config.html">npm-config(7)</a>.</p>
20
21 <h2 id="FILES">FILES</h2>
22
23 <p>The three relevant files are:</p>
24
25 <ul><li>per-user config file (~/.npmrc)</li><li>global config file ($PREFIX/npmrc)</li><li>npm builtin config file (/path/to/npm/npmrc)</li></ul>
26
27 <p>All npm config files are an ini-formatted list of <code>key = value</code>
28 parameters.  Environment variables can be replaced using
29 <code>${VARIABLE_NAME}</code>. For example:</p>
30
31 <pre><code>prefix = ${HOME}/.npm-packages</code></pre>
32
33 <p>Each of these files is loaded, and config options are resolved in
34 priority order.  For example, a setting in the userconfig file would
35 override the setting in the globalconfig file.</p>
36
37 <h3 id="Per-user-config-file">Per-user config file</h3>
38
39 <p><code>$HOME/.npmrc</code> (or the <code>userconfig</code> param, if set in the environment
40 or on the command line)</p>
41
42 <h3 id="Global-config-file">Global config file</h3>
43
44 <p><code>$PREFIX/etc/npmrc</code> (or the <code>globalconfig</code> param, if set above):
45 This file is an ini-file formatted list of <code>key = value</code> parameters.
46 Environment variables can be replaced as above.</p>
47
48 <h3 id="Built-in-config-file">Built-in config file</h3>
49
50 <p><code>path/to/npm/itself/npmrc</code></p>
51
52 <p>This is an unchangeable &quot;builtin&quot; configuration file that npm keeps
53 consistent across updates.  Set fields in here using the <code>./configure</code>
54 script that comes with npm.  This is primarily for distribution
55 maintainers to override default configs in a standard and consistent
56 manner.</p>
57
58 <h2 id="SEE-ALSO">SEE ALSO</h2>
59
60 <ul><li><a href="../files/npm-folders.html">npm-folders(5)</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/package.json.html">package.json(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
61 </div>
62 <p id="footer">npmrc &mdash; npm@1.3.17</p>
63 <script>
64 ;(function () {
65 var wrapper = document.getElementById("wrapper")
66 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
67   .filter(function (el) {
68     return el.parentNode === wrapper
69         && el.tagName.match(/H[1-6]/)
70         && el.id
71   })
72 var l = 2
73   , toc = document.createElement("ul")
74 toc.innerHTML = els.map(function (el) {
75   var i = el.tagName.charAt(1)
76     , out = ""
77   while (i > l) {
78     out += "<ul>"
79     l ++
80   }
81   while (i < l) {
82     out += "</ul>"
83     l --
84   }
85   out += "<li><a href='#" + el.id + "'>" +
86     ( el.innerText || el.text || el.innerHTML)
87     + "</a>"
88   return out
89 }).join("\n")
90 toc.id = "toc"
91 document.body.appendChild(toc)
92 })()
93 </script>