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

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/man/man7/npm-faq.7')
-rw-r--r--deps/npm/man/man7/npm-faq.7128
1 files changed, 64 insertions, 64 deletions
diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7
index 8d0aee053db..907c2591bcf 100644
--- a/deps/npm/man/man7/npm-faq.7
+++ b/deps/npm/man/man7/npm-faq.7
@@ -11,7 +11,7 @@ npm config set viewer browser
.fi
.RE
.P
-to open these documents in your default web browser rather than \fBman\fR\|\.
+to open these documents in your default web browser rather than \fBman\fP\|\.
.SH It didn't work\.
.P
That's not really a question\.
@@ -23,32 +23,32 @@ 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?
.P
-See npm help 5 \fBnpm\-folders\fR
+See npm help 5 \fBnpm\-folders\fP
.P
tl;dr:
.RS 0
.IP \(bu 2
-Use the \fBnpm root\fR command to see where modules go, and the \fBnpm bin\fR
+Use the \fBnpm root\fP command to see where modules go, and the \fBnpm bin\fP
command to see where executables go
.IP \(bu 2
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\|\.
+something with the \fB\-g\fP flag, then its executables go in \fBnpm bin \-g\fP
+and its modules go in \fBnpm root \-g\fP\|\.
.RE
.SH How do I install something on my computer in a central location?
.P
-Install it globally by tacking \fB\-g\fR or \fB\-\-global\fR to the command\. (This
+Install it globally by tacking \fB\-g\fP or \fB\-\-global\fP to the command\. (This
is especially important for command line utilities that need to add
-their bins to the global system \fBPATH\fR\|\.)
-.SH I installed something globally, but I can't \fBrequire()\fR it
+their bins to the global system \fBPATH\fP\|\.)
+.SH I installed something globally, but I can't \fBrequire()\fP it
.P
Install it locally\.
.P
The global install location is a place for command\-line utilities
-to put their bins in the system \fBPATH\fR\|\. It's not for use with \fBrequire()\fR\|\.
+to put their bins in the system \fBPATH\fP\|\. It's not for use with \fBrequire()\fP\|\.
.P
-If you \fBrequire()\fR a module in your code, then that means it's a
+If you \fBrequire()\fP a module in your code, then that means it's a
dependency, and a part of your program\. You need to install it locally
in your program\.
.SH Why can't npm just put everything in one place, like other package managers?
@@ -60,20 +60,20 @@ problems than it solves\.
.P
It is much harder to avoid dependency conflicts without nesting
dependencies\. This is fundamental to the way that npm works, and has
-proven to be an extremely successful approach\. See npm help 5 \fBnpm\-folders\fR for
+proven to be an extremely successful approach\. See npm help 5 \fBnpm\-folders\fP for
more details\.
.P
If you want a package to be installed in one place, and have all your
-programs reference the same copy of it, then use the \fBnpm link\fR command\.
+programs reference the same copy of it, then use the \fBnpm link\fP command\.
That's what it's for\. Install it globally, then link it into each
program that uses it\.
.SH Whatever, I really want the old style 'everything global' style\.
.P
-Write your own package manager\. You could probably even wrap up \fBnpm\fR
+Write your own package manager\. You could probably even wrap up \fBnpm\fP
in a shell script if you really wanted to\.
.P
npm will not help you do something that is known to be a bad idea\.
-.SH Should I check my \fBnode_modules\fR folder into git?
+.SH Should I check my \fBnode_modules\fP folder into git?
.P
Usually, no\. Allow npm to resolve dependencies for your packages\.
.P
@@ -111,23 +111,23 @@ about the (capitalized) NPM program at http://www\.cabiatl\.com/mricro/npm/\|\.
The first seed that eventually grew into this flower was a bash utility
named "pm", which was a shortened descendent of "pkgmakeinst", a
bash function that was used to install various different things on different
-platforms, most often using Yahoo's \fByinst\fR\|\. If \fBnpm\fR was ever an
-acronym for anything, it was \fBnode pm\fR or maybe \fBnew pm\fR\|\.
+platforms, most often using Yahoo's \fByinst\fP\|\. If \fBnpm\fP was ever an
+acronym for anything, it was \fBnode pm\fP or maybe \fBnew pm\fP\|\.
.P
So, in all seriousness, the "npm" project is named after its command\-line
utility, which was organically selected to be easily typed by a right\-handed
programmer using a US QWERTY keyboard layout, ending with the
-right\-ring\-finger in a postition to type the \fB\-\fR key for flags and
+right\-ring\-finger in a postition to type the \fB\-\fP key for flags and
other command\-line arguments\. That command\-line utility is always
lower\-case, though it starts most sentences it is a part of\.
.SH How do I list installed packages?
.P
-\fBnpm ls\fR
+\fBnpm ls\fP
.SH How do I search for packages?
.P
-\fBnpm search\fR
+\fBnpm search\fP
.P
-Arguments are greps\. \fBnpm search jsdom\fR shows jsdom packages\.
+Arguments are greps\. \fBnpm search jsdom\fP shows jsdom packages\.
.SH How do I update npm?
.P
.RS 2
@@ -136,12 +136,12 @@ npm install npm \-g
.fi
.RE
.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\|\.
+You can also update all outdated local packages by doing \fBnpm update\fP without
+any arguments, or global packages by doing \fBnpm update \-g\fP\|\.
.P
Occasionally, the version of npm will progress such that the current
version cannot be properly installed with the version that you have
-installed already\. (Consider, if there is ever a bug in the \fBupdate\fR
+installed already\. (Consider, if there is ever a bug in the \fBupdate\fP
command\.)
.P
In those cases, you can do this:
@@ -151,7 +151,7 @@ In those cases, you can do this:
curl https://www\.npmjs\.com/install\.sh | sh
.fi
.RE
-.SH What is a \fBpackage\fR?
+.SH What is a \fBpackage\fP?
.P
A package is:
.RS 0
@@ -162,13 +162,13 @@ b) a gzipped tarball containing (a)
.IP \(bu 2
c) a url that resolves to (b)
.IP \(bu 2
-d) a \fB<name>@<version>\fR that is published on the registry with (c)
+d) a \fB<name>@<version>\fP that is published on the registry with (c)
.IP \(bu 2
-e) a \fB<name>@<tag>\fR that points to (d)
+e) a \fB<name>@<tag>\fP that points to (d)
.IP \(bu 2
-f) a \fB<name>\fR that has a "latest" tag satisfying (e)
+f) a \fB<name>\fP that has a "latest" tag satisfying (e)
.IP \(bu 2
-g) a \fBgit\fR url that, when cloned, results in (a)\.
+g) a \fBgit\fP url that, when cloned, results in (a)\.
.RE
.P
@@ -188,33 +188,33 @@ git+https://user@hostname/project/blah\.git#commit\-ish
.fi
.RE
.P
-The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as
-an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\.
-.SH What is a \fBmodule\fR?
+The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as
+an argument to \fBgit checkout\fP\|\. The default is \fBmaster\fP\|\.
+.SH What is a \fBmodule\fP?
.P
-A module is anything that can be loaded with \fBrequire()\fR in a Node\.js
+A module is anything that can be loaded with \fBrequire()\fP in a Node\.js
program\. The following things are all examples of things that can be
loaded as modules:
.RS 0
.IP \(bu 2
-A folder with a \fBpackage\.json\fR file containing a \fBmain\fR field\.
+A folder with a \fBpackage\.json\fP file containing a \fBmain\fP field\.
.IP \(bu 2
-A folder with an \fBindex\.js\fR file in it\.
+A folder with an \fBindex\.js\fP file in it\.
.IP \(bu 2
A JavaScript file\.
.RE
.P
Most npm packages are modules, because they are libraries that you
-load with \fBrequire\fR\|\. However, there's no requirement that an npm
+load with \fBrequire\fP\|\. However, there's no requirement that an npm
package be a module! Some only contain an executable command\-line
-interface, and don't provide a \fBmain\fR field for use in Node programs\.
+interface, and don't provide a \fBmain\fP field for use in Node programs\.
.P
Almost all npm packages (at least, those that are Node programs)
\fIcontain\fR many modules within them (because every file they load with
-\fBrequire()\fR is a module)\.
+\fBrequire()\fP is a module)\.
.P
-In the context of a Node program, the \fBmodule\fR is also the thing that
+In the context of a Node program, the \fBmodule\fP is also the thing that
was loaded \fIfrom\fR a file\. For example, in the following program:
.P
.RS 2
@@ -223,25 +223,25 @@ var req = require('request')
.fi
.RE
.P
-we might say that "The variable \fBreq\fR refers to the \fBrequest\fR module"\.
-.SH So, why is it the "\fBnode_modules\fR" folder, but "\fBpackage\.json\fR" file? Why not \fBnode_packages\fR or \fBmodule\.json\fR?
+we might say that "The variable \fBreq\fP refers to the \fBrequest\fP module"\.
+.SH So, why is it the "\fBnode_modules\fP" folder, but "\fBpackage\.json\fP" file? Why not \fBnode_packages\fP or \fBmodule\.json\fP?
.P
-The \fBpackage\.json\fR file defines the package\. (See "What is a
+The \fBpackage\.json\fP file defines the package\. (See "What is a
package?" above\.)
.P
-The \fBnode_modules\fR folder is the place Node\.js looks for modules\.
+The \fBnode_modules\fP folder is the place Node\.js looks for modules\.
(See "What is a module?" above\.)
.P
-For example, if you create a file at \fBnode_modules/foo\.js\fR and then
-had a program that did \fBvar f = require('foo\.js')\fR then it would load
-the module\. However, \fBfoo\.js\fR is not a "package" in this case,
+For example, if you create a file at \fBnode_modules/foo\.js\fP and then
+had a program that did \fBvar f = require('foo\.js')\fP then it would load
+the module\. However, \fBfoo\.js\fP is not a "package" in this case,
because it does not have a package\.json\.
.P
Alternatively, if you create a package which does not have an
-\fBindex\.js\fR or a \fB"main"\fR field in the \fBpackage\.json\fR file, then it is
-not a module\. Even if it's installed in \fBnode_modules\fR, it can't be
-an argument to \fBrequire()\fR\|\.
-.SH \fB"node_modules"\fR is the name of my deity's arch\-rival, and a Forbidden Word in my religion\. Can I configure npm to use a different folder?
+\fBindex\.js\fP or a \fB"main"\fP field in the \fBpackage\.json\fP file, then it is
+not a module\. Even if it's installed in \fBnode_modules\fP, it can't be
+an argument to \fBrequire()\fP\|\.
+.SH \fB"node_modules"\fP is the name of my deity's arch\-rival, and a Forbidden Word in my religion\. Can I configure npm to use a different folder?
.P
No\. This will never happen\. This question comes up sometimes,
because it seems silly from the outside that npm couldn't just be
@@ -249,7 +249,7 @@ configured to put stuff somewhere else, and then npm could load them
from there\. It's an arbitrary spelling choice, right? What's the big
deal?
.P
-At the time of this writing, the string \fB\|'node_modules'\fR appears 151
+At the time of this writing, the string \fB\|'node_modules'\fP appears 151
times in 53 separate files in npm and node core (excluding tests and
documentation)\.
.P
@@ -263,27 +263,27 @@ deference to your deity's delicate feelings regarding spelling\.
Many of the others are in dependencies that npm uses, which are not
necessarily tightly coupled to npm (in the sense that they do not read
npm's configuration files, etc\.) Each of these would have to be
-configured to take the name of the \fBnode_modules\fR folder as a
+configured to take the name of the \fBnode_modules\fP folder as a
parameter\. Complexity hurdle #2\.
.P
Furthermore, npm has the ability to "bundle" dependencies by adding
-the dep names to the \fB"bundledDependencies"\fR list in package\.json,
+the dep names to the \fB"bundledDependencies"\fP list in package\.json,
which causes the folder to be included in the package tarball\. What
if the author of a module bundles its dependencies, and they use a
-different spelling for \fBnode_modules\fR? npm would have to rename the
+different spelling for \fBnode_modules\fP? npm would have to rename the
folder at publish time, and then be smart enough to unpack it using
your locally configured name\. Complexity hurdle #3\.
.P
Furthermore, what happens when you \fIchange\fR this name? Fine, it's
-easy enough the first time, just rename the \fBnode_modules\fR folders to
-\fB\|\./blergyblerp/\fR or whatever name you choose\. But what about when you
+easy enough the first time, just rename the \fBnode_modules\fP folders to
+\fB\|\./blergyblerp/\fP or whatever name you choose\. But what about when you
change it again? npm doesn't currently track any state about past
configuration settings, so this would be rather difficult to do
properly\. It would have to track every previous value for this
config, and always accept any of them, or else yesterday's install may
be broken tomorrow\. Complexity hurdle #4\.
.P
-Never going to happen\. The folder is named \fBnode_modules\fR\|\. It is
+Never going to happen\. The folder is named \fBnode_modules\fP\|\. It is
written indelibly in the Node Way, handed down from the ancient times
of Node 0\.3\.
.SH How do I install node with npm?
@@ -315,12 +315,12 @@ https://github\.com/nanjingboy/nvmw
.RE
.SH How can I use npm for development?
.P
-See npm help 7 \fBnpm\-developers\fR and npm help 5 \fBpackage\.json\fR\|\.
+See npm help 7 \fBnpm\-developers\fP and npm help 5 \fBpackage\.json\fP\|\.
.P
-You'll most likely want to \fBnpm link\fR your development folder\. That's
+You'll most likely want to \fBnpm link\fP your development folder\. That's
awesomely handy\.
.P
-To set up your own private registry, check out npm help 7 \fBnpm\-registry\fR\|\.
+To set up your own private registry, check out npm help 7 \fBnpm\-registry\fP\|\.
.SH Can I list a url as a dependency?
.P
Yes\. It should be a url to a gzipped tarball containing a single folder
@@ -328,10 +328,10 @@ that has a package\.json in its root, or a git url\.
(See "what is a package?" above\.)
.SH How do I symlink to a dev folder so I don't have to keep re\-installing?
.P
-See npm help \fBnpm\-link\fR
+See npm help \fBnpm\-link\fP
.SH The package registry website\. What is that exactly?
.P
-See npm help 7 \fBnpm\-registry\fR\|\.
+See npm help 7 \fBnpm\-registry\fP\|\.
.SH I forgot my password, and can't publish\. How do I reset it?
.P
Go to https://npmjs\.com/forgot\|\.
@@ -353,7 +353,7 @@ on Freenode IRC\.
.SH Why no namespaces?
.P
npm has only one global namespace\. If you want to namespace your own packages,
-you may: simply use the \fB\-\fR character to separate the names or use scoped
+you may: simply use the \fB\-\fP character to separate the names or use scoped
packages\. npm is a mostly anarchic system\. There is not sufficient need to
impose namespace rules on everyone\.
.P
@@ -361,9 +361,9 @@ As of 2\.0, npm supports scoped packages, which allow you to publish a group of
related modules without worrying about name collisions\.
.P
Every npm user owns the scope associated with their username\. For example, the
-user named \fBnpm\fR owns the scope \fB@npm\fR\|\. Scoped packages are published inside a
+user named \fBnpm\fP owns the scope \fB@npm\fP\|\. Scoped packages are published inside a
scope by naming them as if they were files under the scope directory, e\.g\., by
-setting \fBname\fR in \fBpackage\.json\fR to \fB@npm/npm\fR\|\.
+setting \fBname\fP in \fBpackage\.json\fP to \fB@npm/npm\fP\|\.
.P
Scoped packages are supported by the public npm registry\. The npm client is
backwards\-compatible with un\-scoped registries, so it can be used to work with