You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Get the code with git. Use <code>make</code> to build the docs and do other stuff.
69
43
If you plan on hacking on npm, <code>make link</code> is your friend.</p>
70
-
71
44
<p>If you've got the npm source code, you can also semi-permanently set
72
45
arbitrary config keys using the <code>./configure --key=val ...</code>, and then
73
46
run npm commands by doing <code>node cli.js <cmd> <args></code>. (This is helpful
74
47
for testing, or running stuff without actually installing npm itself.)</p>
75
-
76
-
<h2id="Fancy-Windows-Install">Fancy Windows Install</h2>
77
-
48
+
<h2id="fancy-windows-install">Fancy Windows Install</h2>
78
49
<p>You can download a zip file from <ahref="https://npmjs.org/dist/">https://npmjs.org/dist/</a>, and unpack it
79
50
in the same folder where node.exe lives.</p>
80
-
81
51
<p>If that's not fancy enough for you, then you can fetch the code with
82
52
git, and mess with it directly.</p>
83
-
84
-
<h2id="Installing-on-Cygwin">Installing on Cygwin</h2>
85
-
53
+
<h2id="installing-on-cygwin">Installing on Cygwin</h2>
86
54
<p>No.</p>
87
-
88
-
<h2id="Permissions-when-Using-npm-to-Install-Other-Stuff">Permissions when Using npm to Install Other Stuff</h2>
89
-
55
+
<h2id="permissions-when-using-npm-to-install-other-stuff">Permissions when Using npm to Install Other Stuff</h2>
90
56
<p><strong>tl;dr</strong></p>
91
-
92
-
<ul><li>Use <code>sudo</code> for greater safety. Or don't, if you prefer not to.</li><li>npm will downgrade permissions if it's root before running any build
93
-
scripts that package authors specified.</li></ul>
94
-
95
-
<h3id="More-details">More details...</h3>
96
-
57
+
<ul>
58
+
<li>Use <code>sudo</code> for greater safety. Or don't, if you prefer not to.</li>
59
+
<li>npm will downgrade permissions if it's root before running any build
60
+
scripts that package authors specified.</li>
61
+
</ul>
62
+
<h3id="more-details-">More details...</h3>
97
63
<p>As of version 0.3, it is recommended to run npm as root.
98
64
This allows npm to change the user identifier to the <code>nobody</code> user prior
99
65
to running any package build or test commands.</p>
100
-
101
66
<p>If you are not the root user, or if you are on a platform that does not
102
67
support uid switching, then npm will not attempt to change the userid.</p>
103
-
104
68
<p>If you would like to ensure that npm <strong>always</strong> runs scripts as the
105
69
"nobody" user, and have it fail if it cannot downgrade permissions, then
106
70
set the following configuration param:</p>
107
-
108
-
<pre><code>npm config set unsafe-perm false</code></pre>
109
-
110
-
<p>This will prevent running in unsafe mode, even as non-root users.</p>
111
-
112
-
<h2id="Uninstalling">Uninstalling</h2>
113
-
71
+
<pre><code>npm config set unsafe-perm false
72
+
</code></pre><p>This will prevent running in unsafe mode, even as non-root users.</p>
73
+
<h2id="uninstalling">Uninstalling</h2>
114
74
<p>So sad to see you go.</p>
115
-
116
-
<pre><code>sudo npm uninstall npm -g</code></pre>
117
-
118
-
<p>Or, if that fails,</p>
119
-
120
-
<pre><code>sudo make uninstall</code></pre>
121
-
122
-
<h2id="More-Severe-Uninstalling">More Severe Uninstalling</h2>
123
-
75
+
<pre><code>sudo npm uninstall npm -g
76
+
</code></pre><p>Or, if that fails,</p>
77
+
<pre><code>sudo make uninstall
78
+
</code></pre><h2id="more-severe-uninstalling">More Severe Uninstalling</h2>
124
79
<p>Usually, the above instructions are sufficient. That will remove
125
80
npm, but leave behind anything you've installed.</p>
126
-
127
81
<p>If you would like to remove all the packages that you have installed,
128
82
then you can use the <code>npm ls</code> command to find them, and then <code>npm rm</code> to
129
83
remove them.</p>
130
-
131
84
<p>To remove cruft left behind by npm 0.x, you can use the included
132
85
<code>clean-old.sh</code> script file. You can run it conveniently like this:</p>
133
-
134
-
<pre><code>npm explore npm -g -- sh scripts/clean-old.sh</code></pre>
135
-
136
-
<p>npm uses two configuration files, one for per-user configs, and another
86
+
<pre><code>npm explore npm -g -- sh scripts/clean-old.sh
87
+
</code></pre><p>npm uses two configuration files, one for per-user configs, and another
137
88
for global (every-user) configs. You can view them by doing:</p>
138
-
139
89
<pre><code>npm config get userconfig # defaults to ~/.npmrc
140
-
npm config get globalconfig # defaults to /usr/local/etc/npmrc</code></pre>
141
-
142
-
<p>Uninstalling npm does not remove configuration files by default. You
90
+
npm config get globalconfig # defaults to /usr/local/etc/npmrc
91
+
</code></pre><p>Uninstalling npm does not remove configuration files by default. You
143
92
must remove them yourself manually if you want them gone. Note that
144
93
this means that future npm installs will not remember the settings that
// command succeeded, and data might have some info
166
110
})
167
111
npm.on("log", function (message) { .... })
168
-
})</code></pre>
169
-
170
-
<p>The <code>load</code> function takes an object hash of the command-line configs.
112
+
})
113
+
</code></pre><p>The <code>load</code> function takes an object hash of the command-line configs.
171
114
The various <code>npm.commands.<cmd></code> functions take an <strong>array</strong> of
172
115
positional argument <strong>strings</strong>. The last argument to any
173
116
<code>npm.commands.<cmd></code> function is a callback. Some commands take other
174
117
optional arguments. Read the source.</p>
175
-
176
118
<p>You cannot set configs individually for any single npm function at this
177
119
time. Since <code>npm</code> is a singleton, any call to <code>npm.config.set</code> will
178
120
change the value for <em>all</em> npm commands in that process.</p>
179
-
180
121
<p>See <code>./bin/npm-cli.js</code> for an example of pulling config values off of the
181
122
command line arguments using nopt. You may also want to check out <code>npm
182
123
help config</code> to learn about all the options you can set there.</p>
183
-
184
-
<h2id="More-Docs">More Docs</h2>
185
-
124
+
<h2id="more-docs">More Docs</h2>
186
125
<p>Check out the <ahref="https://www.npmjs.org/doc/">docs</a>,
187
126
especially the <ahref="https://www.npmjs.org/doc/faq.html">faq</a>.</p>
188
-
189
127
<p>You can use the <code>npm help</code> command to read any of them.</p>
190
-
191
128
<p>If you're a developer, and you want to use npm to publish your program,
192
129
you should <ahref="https://www.npmjs.org/doc/developers.html">read this</a></p>
193
-
194
-
<h2id="Legal-Stuff">Legal Stuff</h2>
195
-
130
+
<h2id="legal-stuff">Legal Stuff</h2>
196
131
<p>"npm" and "The npm Registry" are owned by npm, Inc.
197
132
All rights reserved. See the included LICENSE file for more details.</p>
198
-
199
133
<p>"Node.js" and "node" are trademarks owned by Joyent, Inc.</p>
200
-
201
134
<p>Modules published on the npm registry are not officially endorsed by
202
135
npm, Inc. or the Node.js project.</p>
203
-
204
136
<p>Data published to the npm registry is not part of npm itself, and is
205
137
the sole property of the publisher. While every effort is made to
206
138
ensure accountability, there is absolutely no guarantee, warrantee, or
207
139
assertion expressed or implied as to the quality, fitness for a
208
140
specific purpose, or lack of malice in any given npm package.</p>
209
-
210
141
<p>If you have a complaint about a package in the public npm registry,
211
142
and cannot <ahref="https://www.npmjs.org/doc/misc/npm-disputes.html">resolve it with the package
212
143
owner</a>, please email
213
-
<ahref="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
214
-
144
+
<ahref="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
215
145
<p>Any data published to The npm Registry (including user account
216
146
information) may be removed or modified at the sole discretion of the
0 commit comments