Welcome to mirror list, hosted at ThFree Co, Russian Federation.

faq.1 « man1 - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 72825cbc3c38ed6e40c84d017af3d3b7e4793815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
.TH "NPM\-FAQ" "1" "March 2011" "" ""
.
.SH "NAME"
\fBnpm-faq\fR \-\- Frequently Asked Questions
.
.SH "Where can I find these docs in HTML?"
\fIhttps://github\.com/isaacs/npm/tree/master/doc\fR
.
.SH "It didn\'t work\."
That\'s not really a question\.
.
.SH "Why didn\'t it work?"
I don\'t know yet\.
.
.P
Read the error output, and if you can\'t figure out what it means,
do what it says and post a bug with all the information it asks for\.
.
.SH "Where does npm put stuff?"
See \fBnpm help folders\fR
.
.P
tl;dr:
.
.IP "\(bu" 4
Use the \fBnpm root\fR command to see where modules go, and the \fBnpm bin\fR
command to see where executables go
.
.IP "\(bu" 4
Global installs are different from local installs\.  If you install
something with the \fB\-g\fR flag, then its executables go in \fBnpm bin \-g\fR
and its modules go in \fBnpm root \-g\fR\|\.
.
.IP "" 0
.
.SH "I installed something globally, but I can\'t `require()` it"
Install it locally\.
.
.SH "I don\'t wanna\."
Ok, then do this:
.
.IP "" 4
.
.nf
echo \'export NODE_PATH="\'$(npm root \-g)\'"\' >> ~/\.bashrc
\|\. ~/\.bashrc
.
.fi
.
.IP "" 0
.
.SH "How do I list installed packages?"
\fBnpm ls\fR
.
.SH "How do I search for packages?"
\fBnpm search\fR
.
.P
Arguments are greps\.  \fBnpm ls jsdom\fR shows jsdom packages\.
.
.SH "How do I update npm?"
\fBNOTE\fR: This is the release candidate documentation\.  To update to the
newer 1\.0 release candidate, do this:
.
.IP "" 4
.
.nf
npm install npm@rc \-g
.
.fi
.
.IP "" 0
.
.P
Once 1\.0 is stable, do this:
.
.IP "" 4
.
.nf
npm update npm \-g
.
.fi
.
.IP "" 0
.
.P
You can also update all outdated local packages by doing \fBnpm update\fR without
any arguments, or global packages by doing \fBnpm update \-g\fR\|\.
.
.SH "What is a `package`?"
A package is:
.
.IP "\(bu" 4
a) a folder containing a program described by a package\.json file
.
.IP "\(bu" 4
b) a gzipped tarball containing (a)
.
.IP "\(bu" 4
c) a url that resolves to (b)
.
.IP "\(bu" 4
d) a \fB<name>@<version>\fR that is published on the registry with (c)
.
.IP "\(bu" 4
e) a \fB<name>@<tag>\fR that points to (d)
.
.IP "\(bu" 4
f) a \fB<name>\fR that has a "latest" tag satisfying (e)
.
.IP "" 0
.
.P
Even if you never publish your package, you can still get a lot of
benefits of using npm if you just want to write a node program (a), and
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b)\.
.
.SH "How do I install node with npm?"
You don\'t\.  Try one of these:
.
.IP "\(bu" 4
\fIhttp://github\.com/isaacs/nave\fR
.
.IP "\(bu" 4
\fIhttp://github\.com/visionmedia/n\fR
.
.IP "\(bu" 4
\fIhttp://github\.com/creationix/nvm\fR
.
.IP "" 0
.
.SH "How can I use npm for development?"
See \fBnpm help developers\fR and \fBnpm help json\fR\|\.
.
.P
You\'ll most likely want to \fBnpm link\fR your development folder\.  That\'s
awesomely handy\.
.
.SH "Can I list a url as a dependency?"
Yes\.  It should be a url to a gzipped tarball containing a single folder
that has a package\.json in its root\.  (See "what is a package?" above\.)
.
.SH "OK, but can I list a git repo as a dependency?"
No\.
.
.P
Source repositories change quickly\.  That is their purpose\.  Whatever
you bundle into your package is your business, but having the registry
refer to a git URL as a "dependency" defeats the whole purpose\.
.
.P
It\'s possible that something a bit more snazzy will be developed at some
point in the future, but not likely\.  The current system allows for a
lot of use cases, and is very easy to maintain\.
.
.P
If you really really want to have the latest checkout in your program,
you can clone the git repo, and then \fBnpm link\fR it, and then \fBnpm link
<name>\fR in any packages that use it to install the link locally to that
package\.
.
.SH "How do I symlink to a dev folder so that I don\'t have to keep re\-installing?"
See \fBnpm help link\fR
.
.SH "The package registry website\.  What is that exactly?"
See \fBnpm help registry\fR for more info, or just visit \fIhttp://github\.com/isaacs/npmjs\.org\fR\|\.
.
.SH "What\'s up with the insecure channel warnings?"
As of this writing, node has problems uploading files over HTTPS\.  That
means that publishes go over HTTP\.
.
.P
Until the problem is solved, npm will complain about being insecure\.
The warnings will disappear when node supports uploading tarballs over
https reliably\.
.
.SH "I forgot my password, and can\'t publish\.  How do I reset it?"
Go to \fIhttp://admin\.npmjs\.org/\fR to reset it\.
.
.SH "I get ECONNREFUSED a lot\.  What\'s up?"
Either the registry is down, or node\'s DNS isn\'t able to reach out\.
This happens a lot if you don\'t follow \fIall\fR the steps in the Cygwin
setup doc\.
.
.P
To check if the registry is down, open up \fIhttp://registry\.npmjs\.org/\-/short\fR
in a web browser\.  This will also tell you if you are just unable to
access the internet for some reason\.
.
.P
If the registry IS down, let me know by emailing \fIi@izs\.me\fR\|\.  I\'ll have
someone kick it or something\.
.
.SH "Who does npm?"
\fBnpm view npm author\fR
.
.P
\fBnpm view npm contributors\fR
.
.SH "I have a question or request not addressed here\. Where should I put it?"
Discuss it on the mailing list, or post an issue\.
.
.IP "\(bu" 4
\fInpm\-@googlegroups\.com\fR
.
.IP "\(bu" 4
\fIhttp://github\.com/isaacs/npm/issues\fR
.
.IP "" 0
.
.SH "Why does npm hate me?"
npm is not capable of hatred\.  It loves everyone, especially you\.