<!doctype html>
< html >
< title > npm< / title >
< meta http-equiv = "content-type" value = "text/html;utf-8" >
< link rel = "stylesheet" type = "text/css" href = "../static/style.css" >
< body >
< div id = "wrapper" >
< h1 > < a href = "../doc/npm.html" > npm< / a > < / h1 > < p > node package manager< / p >
< h2 id = "SYNOPSIS" > SYNOPSIS< / h2 >
< pre > < code > npm < command> [args]< / code > < / pre >
< h2 id = "VERSION" > VERSION< / h2 >
< p > 1.2.30< / p >
< h2 id = "DESCRIPTION" > DESCRIPTION< / h2 >
< p > npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
conflicts intelligently.< / p >
< p > It is extremely configurable to support a wide variety of use cases.
Most commonly, it is used to publish, discover, install, and develop node
programs.< / p >
< p > Run < code > npm help< / code > to get a list of available commands.< / p >
< h2 id = "INTRODUCTION" > INTRODUCTION< / h2 >
< p > You probably got npm because you want to install stuff.< / p >
< p > Use < code > npm install blerg< / code > to install the latest version of " blerg" . Check out
< code > < a href = "../doc/install.html" > install(1)< / a > < / code > for more info. It can do a lot of stuff.< / p >
< p > Use the < code > npm search< / code > command to show everything that' s available.
Use < code > npm ls< / code > to show everything you' ve installed.< / p >
< h2 id = "DIRECTORIES" > DIRECTORIES< / h2 >
< p > See < code > < a href = "../doc/folders.html" > folders(1)< / a > < / code > to learn about where npm puts stuff.< / p >
< p > In particular, npm has two modes of operation:< / p >
< ul > < li > global mode:< br / > npm installs packages into the install prefix at
< 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
defaults to the current working directory. Packages are installed to
< code > ./node_modules< / code > , and bins are installed to < code > ./node_modules/.bin< / code > .< / li > < / ul >
< p > Local mode is the default. Use < code > --global< / code > or < code > -g< / code > on any command to
operate in global mode instead.< / p >
< h2 id = "DEVELOPER-USAGE" > DEVELOPER USAGE< / h2 >
< p > If you' re using npm to develop and publish your code, check out the
following help topics:< / p >
< ul > < li > json:
Make a package.json file. See < code > < a href = "../doc/json.html" > json(1)< / a > < / code > .< / li > < li > link:
For linking your current working code into Node' s path, so that you
don' t have to reinstall every time you make a change. Use
< code > npm link< / code > to do this.< / li > < li > install:
It' s a good idea to install things if you don' t need the symbolic link.
Especially, installing other peoples code from the registry is done via
< code > npm install< / code > < / li > < li > adduser:
Create an account or log in. Credentials are stored in the
user config file.< / li > < li > publish:
Use the < code > npm publish< / code > command to upload your code to the registry.< / li > < / ul >
< h2 id = "CONFIGURATION" > CONFIGURATION< / h2 >
< p > npm is extremely configurable. It reads its configuration options from
5 places.< / p >
< ul > < li > Command line switches:< br / > Set a config with < code > --key val< / code > . All keys take a value, even if they
are booleans (the config parser doesn' t know what the options are at
the time of parsing.) If no value is provided, then the option is set
to boolean < code > true< / code > .< / li > < li > Environment Variables:< br / > Set any config by prefixing the name in an environment variable with
< 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
present, it is parsed. If the < code > userconfig< / code > option is set in the cli
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
this resolves to /usr/local/etc/npmrc) will be parsed if it is found.
If the < code > globalconfig< / code > option is set in the cli, env, or user config,
then that file is parsed instead.< / li > < li > Defaults:< br / > npm' s default configuration options are defined in
lib/utils/config-defs.js. These must not be changed.< / li > < / ul >
< p > See < code > < a href = "../doc/config.html" > config(1)< / a > < / code > for much much more information.< / p >
< h2 id = "CONTRIBUTIONS" > CONTRIBUTIONS< / h2 >
< p > Patches welcome!< / p >
< ul > < li > code:
Read through < code > < a href = "../doc/coding-style.html" > coding-style(1)< / a > < / code > if you plan to submit code.
You don' t have to agree with it, but you do have to follow it.< / li > < li > docs:
If you find an error in the documentation, edit the appropriate markdown
file in the " doc" folder. (Don' t worry about generating the man page.)< / li > < / ul >
< p > Contributors are listed in npm' s < code > package.json< / code > file. You can view them
easily by doing < code > npm view npm contributors< / code > .< / p >
< p > If you would like to contribute, but don' t know what to work on, check
the issues list or ask on the mailing list.< / p >
< 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 >
< h2 id = "BUGS" > BUGS< / h2 >
< p > When you find issues, please report them:< / p >
< ul > < li > web:
< a href = "http://github.com/isaacs/npm/issues" > http://github.com/isaacs/npm/issues< / a > < / li > < li > email:
< a href = "mailto:npm-@googlegroups.com" > npm-@googlegroups.com< / a > < / li > < / ul >
< p > Be sure to include < em > all< / em > of the output from the npm command that didn' t work
as expected. The < code > npm-debug.log< / code > file is also helpful to provide.< / p >
< p > You can also look for isaacs in #node.js on irc://irc.freenode.net. He
will no doubt tell you to put the output in a gist or email.< / p >
< h2 id = "HISTORY" > HISTORY< / h2 >
< p > See < a href = "../doc/changelog.html" > changelog(1)< / a > < / p >
< h2 id = "AUTHOR" > AUTHOR< / h2 >
< p > < a href = "http://blog.izs.me/" > Isaac Z. Schlueter< / a > ::
< a href = "https://github.com/isaacs/" > isaacs< / a > ::
< a href = "http://twitter.com/izs" > @izs< / a > ::
< a href = "mailto:i@izs.me" > i@izs.me< / a > < / p >
< h2 id = "SEE-ALSO" > SEE ALSO< / h2 >
< ul > < li > < a href = "../doc/help.html" > help(1)< / a > < / li > < li > < a href = "../doc/faq.html" > faq(1)< / a > < / li > < li > < a href = "../doc/README.html" > README< / a > < / li > < li > < a href = "../doc/json.html" > json(1)< / a > < / li > < li > < a href = "../doc/install.html" > install(1)< / a > < / li > < li > < a href = "../doc/config.html" > config(1)< / a > < / li > < li > < a href = "../doc/index.html" > index(1)< / a > < / li > < li > < a href = "../api/npm.html" > npm(3)< / a > < / li > < / ul >
< / div >
< p id = "footer" > npm — npm@1.2.30< / p >
< script >
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
.filter(function (el) {
return el.parentNode === wrapper
& & el.tagName.match(/H[1-6]/)
& & el.id
})
var l = 2
, toc = document.createElement("ul")
toc.innerHTML = els.map(function (el) {
var i = el.tagName.charAt(1)
, out = ""
while (i > l) {
out += "< ul > "
l ++
}
while (i < l ) {
out += "< / ul > "
l --
}
out += "< li > < a href = '#" + el.id + "' > " +
( el.innerText || el.text || el.innerHTML)
+ "< / a > "
return out
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
< / script >
< / body > < / html >