Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.0.0rc4
Fetching contributors…

Cannot retrieve contributors at this time

782 lines (781 sloc) 12.278 kb
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
.TH "NPM\-CONFIG" "1" "March 2011" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- Manage the npm configuration file
.
.SH "SYNOPSIS"
.
.nf
npm config set <key> <value> [\-\-global]
npm config get <key>
npm config delete <key>
npm config list
npm config edit
npm get <key>
npm set <key> <value> [\-\-global]
.
.fi
.
.SH "DESCRIPTION"
npm gets its configuration values from 5 sources, in this priority:
.
.IP "\(bu" 4
cli:
The command line flags\. Putting \fB\-\-foo bar\fR on the command line sets the \fBfoo\fR configuration parameter to \fB"bar"\fR\|\. A \fB\-\-\fR argument tells the cli
parser to stop reading flags\. A \fB\-\-flag\fR parameter that is at the \fIend\fR of
the command will be given the value of \fBtrue\fR\|\.
.
.IP "\(bu" 4
env:
Any environment variables that start with \fBnpm_config_\fR will be interpreted
as a configuration parameter\. For example, putting \fBnpm_config_foo=bar\fR in
your environment will set the \fBfoo\fR configuration parameter to \fBbar\fR\|\. Any
environment configurations that are not given a value will be given the value
of \fBtrue\fR\|\. Config values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will
work the same\.
.
.IP "\(bu" 4
$HOME/\.npmrc (or the \fBuserconfig\fR param, if set above):
This file is an ini\-file formatted list of \fBkey = value\fR parameters\.
.
.IP "\(bu" 4
$PREFIX/etc/npmrc (or the \fBglobalconfig\fR param, if set above):
This file is an ini\-file formatted list of \fBkey = value\fR parameters
.
.IP "\(bu" 4
default configs:
This is a set of configuration parameters that are internal to npm, and are
defaults if nothing else is specified\.
.
.IP "" 0
.
.SH "Sub\-commands"
Config supports the following sub\-commands:
.
.SS "set"
.
.nf
npm config set key value
.
.fi
.
.P
Sets the config key to the value\.
.
.P
If value is omitted, then it sets it to "true"\.
.
.SS "get"
.
.nf
npm config get key
.
.fi
.
.P
Echo the config value to stdout\.
.
.SS "list"
.
.nf
npm config list
.
.fi
.
.P
Show all the config settings\.
.
.SS "delete"
.
.nf
npm config delete key
.
.fi
.
.P
Deletes the key from all configuration files\.
.
.SS "edit"
.
.nf
npm config edit
.
.fi
.
.P
Opens the config file in an editor\. Use the \fB\-\-global\fR flag to edit the
global config\.
.
.SH "Shorthands and Other CLI Niceties"
The following shorthands are parsed on the command\-line:
.
.IP "\(bu" 4
\fB\-v\fR: \fB\-\-version\fR
.
.IP "\(bu" 4
\fB\-h\fR, \fB\-?\fR, \fB\-\-help\fR, \fB\-H\fR: \fB\-\-usage\fR
.
.IP "\(bu" 4
\fB\-s\fR, \fB\-\-silent\fR: \fB\-\-loglevel silent\fR
.
.IP "\(bu" 4
\fB\-d\fR: \fB\-\-loglevel info\fR
.
.IP "\(bu" 4
\fB\-dd\fR, \fB\-\-verbose\fR: \fB\-\-loglevel verbose\fR
.
.IP "\(bu" 4
\fB\-ddd\fR: \fB\-\-loglevel silly\fR
.
.IP "\(bu" 4
\fB\-g\fR: \fB\-\-global\fR
.
.IP "\(bu" 4
\fB\-l\fR: \fB\-\-long\fR
.
.IP "\(bu" 4
\fB\-p\fR, \fB\-\-porcelain\fR: \fB\-\-parseable\fR
.
.IP "\(bu" 4
\fB\-reg\fR: \fB\-\-registry\fR
.
.IP "\(bu" 4
\fB\-v\fR: \fB\-\-version\fR
.
.IP "\(bu" 4
\fB\-f\fR: \fB\-\-force\fR
.
.IP "\(bu" 4
\fB\-l\fR: \fB\-\-long\fR
.
.IP "\(bu" 4
\fB\-desc\fR: \fB\-\-description\fR
.
.IP "\(bu" 4
\fBll\fR and \fBla\fR commands: \fBls \-\-long\fR
.
.IP "" 0
.
.P
If the specified configuration param resolves unambiguously to a known
configuration parameter, then it is expanded to that configuration
parameter\. For example:
.
.IP "" 4
.
.nf
npm ls \-\-par
# same as:
npm ls \-\-parseable
.
.fi
.
.IP "" 0
.
.P
If multiple single\-character shorthands are strung together, and the
resulting combination is unambiguously not some other configuration
param, then it is expanded to its various component pieces\. For
example:
.
.IP "" 4
.
.nf
npm ls \-gpld
# same as:
npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info
.
.fi
.
.IP "" 0
.
.SH "Per\-Package Config Settings"
When running scripts (see \fBnpm help scripts\fR)
the package\.json "config" keys are overwritten in the environment if
there is a config param of \fB<name>[@<version>]:<key>\fR\|\. For example, if
the package\.json has this:
.
.IP "" 4
.
.nf
{ "name" : "foo"
, "config" : { "port" : "8080" }
, "scripts" : { "start" : "node server\.js" } }
.
.fi
.
.IP "" 0
.
.P
and the server\.js is this:
.
.IP "" 4
.
.nf
http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
.
.fi
.
.IP "" 0
.
.P
then the user could change the behavior by doing:
.
.IP "" 4
.
.nf
npm config set foo:port 80
.
.fi
.
.IP "" 0
.
.SH "Config Settings"
.
.SS "browser"
.
.IP "\(bu" 4
Default: OS X: \fB"open"\fR, others: \fB"google\-chrome"\fR
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
The browser that is called by the \fBnpm docs\fR command to open websites\.
.
.SS "cache"
.
.IP "\(bu" 4
Default: Windows: \fB~/npm\-cache\fR, Posix: \fB~/\.npm\fR
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The location of npm\'s cache directory\. See \fBnpm help cache\fR
.
.SS "color"
.
.IP "\(bu" 4
Default: true
.
.IP "\(bu" 4
Type: Boolean or \fB"always"\fR
.
.IP "" 0
.
.P
If false, never shows colors\. If \fB"always"\fR then always shows colors\.
If true, then only prints color codes for tty file descriptors\.
.
.SS "depth"
.
.IP "\(bu" 4
Default: Infinity
.
.IP "\(bu" 4
Type: Number
.
.IP "" 0
.
.P
The depth to go when recursing directories for \fBnpm ls\fR and \fBnpm cache ls\fR\|\.
.
.SS "description"
.
.IP "\(bu" 4
Default: true
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to show the description in \fBnpm search\fR
.
.SS "dev"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to install \fBdev\-dependencies\fR along with packages\.
.
.P
Note that \fBdev\-dependencies\fR are also installed if the \fBnpat\fR flag is
set\.
.
.SS "editor"
.
.IP "\(bu" 4
Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\.
.
.SS "force"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Makes various commands more forceful\.
.
.IP "\(bu" 4
lifecycle script failure does not block progress\.
.
.IP "\(bu" 4
publishing clobbers previously published versions\.
.
.IP "\(bu" 4
skips cache when requesting from the registry\.
.
.IP "\(bu" 4
prevents checks against clobbering non\-npm files\.
.
.IP "" 0
.
.SS "global"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory\. See \fBnpm help global\fR for more on the differences in behavior\.
.
.IP "\(bu" 4
packages are installed into the \fBprefix/node_modules\fR folder, instead of the
current working directory\.
.
.IP "\(bu" 4
bin files are linked to \fBprefix/bin\fR
.
.IP "\(bu" 4
man pages are linked to \fBprefix/share/man\fR
.
.IP "" 0
.
.SS "globalconfig"
.
.IP "\(bu" 4
Default: {prefix}/etc/npmrc
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The config file to read for global config options\.
.
.SS "group"
.
.IP "\(bu" 4
Default: GID of the current process
.
.IP "\(bu" 4
Type: String or Number
.
.IP "" 0
.
.P
The group to use when running package scripts in global mode as the root
user\.
.
.SS "gzipbin"
.
.IP "\(bu" 4
Default: "gzip"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The gzip binary
.
.SS "logfd"
.
.IP "\(bu" 4
Default: stderr file descriptor
.
.IP "\(bu" 4
Type: Number or Stream
.
.IP "" 0
.
.P
The location to write log output\.
.
.SS "loglevel"
.
.IP "\(bu" 4
Default: "warn"
.
.IP "\(bu" 4
Type: String
.
.IP "\(bu" 4
Values: "silent", "win", "error", "warn", "info", "verbose", "silly"
.
.IP "" 0
.
.P
What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\.
.
.SS "long"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to show extended information in \fBnpm ls\fR
.
.SS "node\-version"
.
.IP "\(bu" 4
Default: process\.version
.
.IP "\(bu" 4
Type: semver
.
.IP "" 0
.
.P
The node version to use when checking package\'s "engines" hash\.
.
.SS "npat"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to run tests on installation and report results to the \fBnpaturl\fR\|\.
.
.SS "npaturl"
.
.IP "\(bu" 4
Default: Not yet implemented
.
.IP "\(bu" 4
Type: url
.
.IP "" 0
.
.P
The url to report npat test results\.
.
.SS "onload\-script"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
A node module to \fBrequire()\fR when npm loads\. Useful for programmatic
usage\.
.
.SS "outfd"
.
.IP "\(bu" 4
Default: standard output file descriptor
.
.IP "\(bu" 4
Type: Number or Stream
.
.IP "" 0
.
.P
Where to write "normal" output\. This has no effect on log output\.
.
.SS "parseable"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to output parseable results from commands that write to
standard output\.
.
.SS "prefix"
.
.IP "\(bu" 4
Default: node\'s process\.installPrefix
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The location to install global items\. If set on the command line, then
it forces non\-global commands to run in the specified folder\.
.
.SS "proxy"
.
.IP "\(bu" 4
Default: "HTTP\fIPROXY" or "http\fRproxy" environment variable, or null
.
.IP "\(bu" 4
Type: url
.
.IP "" 0
.
.P
A proxy to use for outgoing http requests\.
.
.SS "rebuild\-bundle"
.
.IP "\(bu" 4
Default: true
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Set to some truish value to rebuild bundled dependencies after
installation\.
.
.SS "registry"
.
.IP "\(bu" 4
Default: https://registry\.npmjs\.org/
.
.IP "\(bu" 4
Type: url
.
.IP "" 0
.
.P
The base URL of the npm package registry\.
.
.SS "searchopts"
.
.IP "\(bu" 4
Default: ""
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
Space\-separated options that are always passed to search\.
.
.SS "searchexclude"
.
.IP "\(bu" 4
Default: ""
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
Space\-separated options that limit the results from search\.
.
.SS "shell"
.
.IP "\(bu" 4
Default: SHELL environment variable, or "bash"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The shell to run for the \fBnpm explore\fR command\.
.
.SS "tag"
.
.IP "\(bu" 4
Default: latest
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
If you ask npm to install a package and don\'t tell it a specific version, then
it will install the specified tag\.
.
.P
Also the tag that is added to the package@version specified by the \fBnpm
tag\fR command, if no explicit tag is given\.
.
.SS "tar"
.
.IP "\(bu" 4
Default: TAR environment variable, or "tar"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The tar executable
.
.SS "tmp"
.
.IP "\(bu" 4
Default: TMPDIR environment variable, or "/tmp"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
Where to store temporary files and folders\. All temp files are deleted
on success, but left behind on failure for forensic purposes\.
.
.SS "unsafe\-perm"
.
.IP "\(bu" 4
Default: false if running as root, true otherwise
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Set to true to suppress the UID/GID switching when running package
scripts\. If set explicitly to false, then installing as a non\-root user
will fail\.
.
.SS "usage"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Set to show short usage output (like the \-H output)
instead of complete help when doing \fBnpm help\fR\|\.
.
.SS "user"
.
.IP "\(bu" 4
Default: "nobody"
.
.IP "\(bu" 4
Type: String or Number
.
.IP "" 0
.
.P
The UID to set to when running package scripts as root\.
.
.SS "username"
.
.IP "\(bu" 4
Default: null
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
The username on the npm registry\. Set with \fBnpm adduser\fR
.
.SS "userconfig"
.
.IP "\(bu" 4
Default: ~/\.npmrc on Posix, or ~/npm\-config on Windows
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The location of user\-level configuration settings\.
.
.SS "version"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: boolean
.
.IP "" 0
.
.P
If true, output the npm version and exit successfully\.
.
.P
Only relevant when specified explicitly on the command line\.
.
.SS "viewer"
.
.IP "\(bu" 4
Default: "man"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The program to use to view help content\.
Jump to Line
Something went wrong with that request. Please try again.