config.7 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732
  1. .TH "CONFIG" "7" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBconfig\fR \- More than you probably want to know about npm configuration
  4. .SS Description
  5. .P
  6. npm gets its configuration values from the following sources, sorted by priority:
  7. .SS Command Line Flags
  8. .P
  9. Putting \fB\-\-foo bar\fP on the command line sets the \fBfoo\fP configuration
  10. parameter to \fB"bar"\fP\|\. A \fB\-\-\fP argument tells the cli parser to stop
  11. reading flags\. Using \fB\-\-flag\fP without specifying any value will set
  12. the value to \fBtrue\fP\|\.
  13. .P
  14. Example: \fB\-\-flag1 \-\-flag2\fP will set both configuration parameters
  15. to \fBtrue\fP, while \fB\-\-flag1 \-\-flag2 bar\fP will set \fBflag1\fP to \fBtrue\fP,
  16. and \fBflag2\fP to \fBbar\fP\|\. Finally, \fB\-\-flag1 \-\-flag2 \-\- bar\fP will set
  17. both configuration parameters to \fBtrue\fP, and the \fBbar\fP is taken
  18. as a command argument\.
  19. .SS Environment Variables
  20. .P
  21. Any environment variables that start with \fBnpm_config_\fP will be
  22. interpreted as a configuration parameter\. For example, putting
  23. \fBnpm_config_foo=bar\fP in your environment will set the \fBfoo\fP
  24. configuration parameter to \fBbar\fP\|\. Any environment configurations that
  25. are not given a value will be given the value of \fBtrue\fP\|\. Config
  26. values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fP will work the
  27. same\. However, please note that inside npm help \fBscripts\fP
  28. npm will set its own environment variables and Node will prefer
  29. those lowercase versions over any uppercase ones that you might set\.
  30. For details see this issue \fIhttps://github\.com/npm/npm/issues/14528\fR\|\.
  31. .P
  32. Notice that you need to use underscores instead of dashes, so \fB\-\-allow\-same\-version\fP
  33. would become \fBnpm_config_allow_same_version=true\fP\|\.
  34. .SS npmrc Files
  35. .P
  36. The four relevant files are:
  37. .RS 0
  38. .IP \(bu 2
  39. per\-project configuration file (\fB/path/to/my/project/\.npmrc\fP)
  40. .IP \(bu 2
  41. per\-user configuration file (defaults to \fB$HOME/\.npmrc\fP; configurable via CLI
  42. option \fB\-\-userconfig\fP or environment variable \fB$NPM_CONFIG_USERCONFIG\fP)
  43. .IP \(bu 2
  44. global configuration file (defaults to \fB$PREFIX/etc/npmrc\fP; configurable via
  45. CLI option \fB\-\-globalconfig\fP or environment variable \fB$NPM_CONFIG_GLOBALCONFIG\fP)
  46. .IP \(bu 2
  47. npm's built\-in configuration file (\fB/path/to/npm/npmrc\fP)
  48. .RE
  49. .P
  50. See npm help npmrc for more details\.
  51. .SS Default Configs
  52. .P
  53. Run \fBnpm config ls \-l\fP to see a set of configuration parameters that are
  54. internal to npm, and are defaults if nothing else is specified\.
  55. .SS Shorthands and Other CLI Niceties
  56. .P
  57. The following shorthands are parsed on the command\-line:
  58. .RS 0
  59. .IP \(bu 2
  60. \fB\-v\fP: \fB\-\-version\fP
  61. .IP \(bu 2
  62. \fB\-h\fP, \fB\-?\fP, \fB\-\-help\fP, \fB\-H\fP: \fB\-\-usage\fP
  63. .IP \(bu 2
  64. \fB\-s\fP, \fB\-\-silent\fP: \fB\-\-loglevel silent\fP
  65. .IP \(bu 2
  66. \fB\-q\fP, \fB\-\-quiet\fP: \fB\-\-loglevel warn\fP
  67. .IP \(bu 2
  68. \fB\-d\fP: \fB\-\-loglevel info\fP
  69. .IP \(bu 2
  70. \fB\-dd\fP, \fB\-\-verbose\fP: \fB\-\-loglevel verbose\fP
  71. .IP \(bu 2
  72. \fB\-ddd\fP: \fB\-\-loglevel silly\fP
  73. .IP \(bu 2
  74. \fB\-g\fP: \fB\-\-global\fP
  75. .IP \(bu 2
  76. \fB\-C\fP: \fB\-\-prefix\fP
  77. .IP \(bu 2
  78. \fB\-l\fP: \fB\-\-long\fP
  79. .IP \(bu 2
  80. \fB\-m\fP: \fB\-\-message\fP
  81. .IP \(bu 2
  82. \fB\-p\fP, \fB\-\-porcelain\fP: \fB\-\-parseable\fP
  83. .IP \(bu 2
  84. \fB\-reg\fP: \fB\-\-registry\fP
  85. .IP \(bu 2
  86. \fB\-f\fP: \fB\-\-force\fP
  87. .IP \(bu 2
  88. \fB\-desc\fP: \fB\-\-description\fP
  89. .IP \(bu 2
  90. \fB\-S\fP: \fB\-\-save\fP
  91. .IP \(bu 2
  92. \fB\-P\fP: \fB\-\-save\-prod\fP
  93. .IP \(bu 2
  94. \fB\-D\fP: \fB\-\-save\-dev\fP
  95. .IP \(bu 2
  96. \fB\-O\fP: \fB\-\-save\-optional\fP
  97. .IP \(bu 2
  98. \fB\-B\fP: \fB\-\-save\-bundle\fP
  99. .IP \(bu 2
  100. \fB\-E\fP: \fB\-\-save\-exact\fP
  101. .IP \(bu 2
  102. \fB\-y\fP: \fB\-\-yes\fP
  103. .IP \(bu 2
  104. \fB\-n\fP: \fB\-\-yes false\fP
  105. .IP \(bu 2
  106. \fBll\fP and \fBla\fP commands: \fBls \-\-long\fP
  107. .RE
  108. .P
  109. If the specified configuration param resolves unambiguously to a known
  110. configuration parameter, then it is expanded to that configuration
  111. parameter\. For example:
  112. .P
  113. .RS 2
  114. .nf
  115. npm ls \-\-par
  116. # same as:
  117. npm ls \-\-parseable
  118. .fi
  119. .RE
  120. .P
  121. If multiple single\-character shorthands are strung together, and the
  122. resulting combination is unambiguously not some other configuration
  123. param, then it is expanded to its various component pieces\. For
  124. example:
  125. .P
  126. .RS 2
  127. .nf
  128. npm ls \-gpld
  129. # same as:
  130. npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info
  131. .fi
  132. .RE
  133. .SS Per\-Package Config Settings
  134. .P
  135. When running scripts (see npm help \fBscripts\fP) the package\.json "config"
  136. keys are overwritten in the environment if there is a config param of
  137. \fB<name>[@<version>]:<key>\fP\|\. For example, if the package\.json has
  138. this:
  139. .P
  140. .RS 2
  141. .nf
  142. { "name" : "foo"
  143. , "config" : { "port" : "8080" }
  144. , "scripts" : { "start" : "node server\.js" } }
  145. .fi
  146. .RE
  147. .P
  148. and the server\.js is this:
  149. .P
  150. .RS 2
  151. .nf
  152. http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
  153. .fi
  154. .RE
  155. .P
  156. then the user could change the behavior by doing:
  157. .P
  158. .RS 2
  159. .nf
  160. npm config set foo:port 80
  161. .fi
  162. .RE
  163. .P
  164. See npm help package\.json for more information\.
  165. .SS Config Settings
  166. .SS access
  167. .RS 0
  168. .IP \(bu 2
  169. Default: \fBrestricted\fP
  170. .IP \(bu 2
  171. Type: Access
  172. .RE
  173. .P
  174. When publishing scoped packages, the access level defaults to \fBrestricted\fP\|\. If
  175. you want your scoped package to be publicly viewable (and installable) set
  176. \fB\-\-access=public\fP\|\. The only valid values for \fBaccess\fP are \fBpublic\fP and
  177. \fBrestricted\fP\|\. Unscoped packages \fIalways\fR have an access level of \fBpublic\fP\|\.
  178. .SS allow\-same\-version
  179. .RS 0
  180. .IP \(bu 2
  181. Default: false
  182. .IP \(bu 2
  183. Type: Boolean
  184. .RE
  185. .P
  186. Prevents throwing an error when \fBnpm version\fP is used to set the new version
  187. to the same value as the current version\.
  188. .SS always\-auth
  189. .RS 0
  190. .IP \(bu 2
  191. Default: false
  192. .IP \(bu 2
  193. Type: Boolean
  194. .RE
  195. .P
  196. Force npm to always require authentication when accessing the registry,
  197. even for \fBGET\fP requests\.
  198. .SS also
  199. .RS 0
  200. .IP \(bu 2
  201. Default: null
  202. .IP \(bu 2
  203. Type: String
  204. .RE
  205. .P
  206. When "dev" or "development" and running local \fBnpm shrinkwrap\fP,
  207. \fBnpm outdated\fP, or \fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\.
  208. .SS audit
  209. .RS 0
  210. .IP \(bu 2
  211. Default: true
  212. .IP \(bu 2
  213. Type: Boolean
  214. .RE
  215. .P
  216. When "true" submit audit reports alongside \fBnpm install\fP runs to the default
  217. registry and all registries configured for scopes\. See the documentation
  218. for npm help \fBaudit\fP for details on what is submitted\.
  219. .SS audit\-level
  220. .RS 0
  221. .IP \(bu 2
  222. Default: \fB"low"\fP
  223. .IP \(bu 2
  224. Type: \fB\|'low'\fP, \fB\|'moderate'\fP, \fB\|'high'\fP, \fB\|'critical'\fP
  225. .RE
  226. .P
  227. The minimum level of vulnerability for \fBnpm audit\fP to exit with
  228. a non\-zero exit code\.
  229. .SS auth\-type
  230. .RS 0
  231. .IP \(bu 2
  232. Default: \fB\|'legacy'\fP
  233. .IP \(bu 2
  234. Type: \fB\|'legacy'\fP, \fB\|'sso'\fP, \fB\|'saml'\fP, \fB\|'oauth'\fP
  235. .RE
  236. .P
  237. What authentication strategy to use with \fBadduser\fP/\fBlogin\fP\|\.
  238. .SS before
  239. .RS 0
  240. .IP \(bu 2
  241. Alias: enjoy\-by
  242. .IP \(bu 2
  243. Default: null
  244. .IP \(bu 2
  245. Type: Date
  246. .RE
  247. .P
  248. If passed to \fBnpm install\fP, will rebuild the npm tree such that only versions
  249. that were available \fBon or before\fR the \fB\-\-before\fP time get installed\.
  250. If there's no versions available for the current set of direct dependencies, the
  251. command will error\.
  252. .P
  253. If the requested version is a \fBdist\-tag\fP and the given tag does not pass the
  254. \fB\-\-before\fP filter, the most recent version less than or equal to that tag will
  255. be used\. For example, \fBfoo@latest\fP might install \fBfoo@1\.2\fP even though \fBlatest\fP
  256. is \fB2\.0\fP\|\.
  257. .SS bin\-links
  258. .RS 0
  259. .IP \(bu 2
  260. Default: \fBtrue\fP
  261. .IP \(bu 2
  262. Type: Boolean
  263. .RE
  264. .P
  265. Tells npm to create symlinks (or \fB\|\.cmd\fP shims on Windows) for package
  266. executables\.
  267. .P
  268. Set to false to have it not do this\. This can be used to work around
  269. the fact that some file systems don't support symlinks, even on
  270. ostensibly Unix systems\.
  271. .SS browser
  272. .RS 0
  273. .IP \(bu 2
  274. Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP
  275. .IP \(bu 2
  276. Type: String
  277. .RE
  278. .P
  279. The browser that is called by the \fBnpm docs\fP command to open websites\.
  280. .SS ca
  281. .RS 0
  282. .IP \(bu 2
  283. Default: The npm CA certificate
  284. .IP \(bu 2
  285. Type: String, Array or null
  286. .RE
  287. .P
  288. The Certificate Authority signing certificate that is trusted for SSL
  289. connections to the registry\. Values should be in PEM format (Windows calls it "Base\-64 encoded X\.509 (\.CER)") with newlines
  290. replaced by the string "\\n"\. For example:
  291. .P
  292. .RS 2
  293. .nf
  294. ca="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-"
  295. .fi
  296. .RE
  297. .P
  298. Set to \fBnull\fP to only allow "known" registrars, or to a specific CA cert
  299. to trust only that specific signing authority\.
  300. .P
  301. Multiple CAs can be trusted by specifying an array of certificates:
  302. .P
  303. .RS 2
  304. .nf
  305. ca[]="\.\.\."
  306. ca[]="\.\.\."
  307. .fi
  308. .RE
  309. .P
  310. See also the \fBstrict\-ssl\fP config\.
  311. .SS cafile
  312. .RS 0
  313. .IP \(bu 2
  314. Default: \fBnull\fP
  315. .IP \(bu 2
  316. Type: path
  317. .RE
  318. .P
  319. A path to a file containing one or multiple Certificate Authority signing
  320. certificates\. Similar to the \fBca\fP setting, but allows for multiple CA's, as
  321. well as for the CA information to be stored in a file on disk\.
  322. .SS cache
  323. .RS 0
  324. .IP \(bu 2
  325. Default: Windows: \fB%AppData%\\npm\-cache\fP, Posix: \fB~/\.npm\fP
  326. .IP \(bu 2
  327. Type: path
  328. .RE
  329. .P
  330. The location of npm's cache directory\. See npm help \fBcache\fP
  331. .SS cache\-lock\-stale
  332. .RS 0
  333. .IP \(bu 2
  334. Default: 60000 (1 minute)
  335. .IP \(bu 2
  336. Type: Number
  337. .RE
  338. .P
  339. The number of ms before cache folder lockfiles are considered stale\.
  340. .SS cache\-lock\-retries
  341. .RS 0
  342. .IP \(bu 2
  343. Default: 10
  344. .IP \(bu 2
  345. Type: Number
  346. .RE
  347. .P
  348. Number of times to retry to acquire a lock on cache folder lockfiles\.
  349. .SS cache\-lock\-wait
  350. .RS 0
  351. .IP \(bu 2
  352. Default: 10000 (10 seconds)
  353. .IP \(bu 2
  354. Type: Number
  355. .RE
  356. .P
  357. Number of ms to wait for cache lock files to expire\.
  358. .SS cache\-max
  359. .RS 0
  360. .IP \(bu 2
  361. Default: Infinity
  362. .IP \(bu 2
  363. Type: Number
  364. .RE
  365. .P
  366. \fBDEPRECATED\fR: This option has been deprecated in favor of \fB\-\-prefer\-online\fP\|\.
  367. .P
  368. \fB\-\-cache\-max=0\fP is an alias for \fB\-\-prefer\-online\fP\|\.
  369. .SS cache\-min
  370. .RS 0
  371. .IP \(bu 2
  372. Default: 10
  373. .IP \(bu 2
  374. Type: Number
  375. .RE
  376. .P
  377. \fBDEPRECATED\fR: This option has been deprecated in favor of \fB\-\-prefer\-offline\fP\|\.
  378. .P
  379. \fB\-\-cache\-min=9999 (or bigger)\fP is an alias for \fB\-\-prefer\-offline\fP\|\.
  380. .SS cert
  381. .RS 0
  382. .IP \(bu 2
  383. Default: \fBnull\fP
  384. .IP \(bu 2
  385. Type: String
  386. .RE
  387. .P
  388. A client certificate to pass when accessing the registry\. Values should be in
  389. PEM format (Windows calls it "Base\-64 encoded X\.509 (\.CER)") with newlines replaced by the string "\\n"\. For example:
  390. .P
  391. .RS 2
  392. .nf
  393. cert="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-"
  394. .fi
  395. .RE
  396. .P
  397. It is \fInot\fR the path to a certificate file (and there is no "certfile" option)\.
  398. .SS cidr
  399. .RS 0
  400. .IP \(bu 2
  401. Default: \fBnull\fP
  402. .IP \(bu 2
  403. Type: String, Array, null
  404. .RE
  405. .P
  406. This is a list of CIDR address to be used when configuring limited access tokens with the \fBnpm token create\fP command\.
  407. .SS color
  408. .RS 0
  409. .IP \(bu 2
  410. Default: true
  411. .IP \(bu 2
  412. Type: Boolean or \fB"always"\fP
  413. .RE
  414. .P
  415. If false, never shows colors\. If \fB"always"\fP then always shows colors\.
  416. If true, then only prints color codes for tty file descriptors\.
  417. .P
  418. This option can also be changed using the environment: colors are
  419. disabled when the environment variable \fBNO_COLOR\fP is set to any value\.
  420. .SS depth
  421. .RS 0
  422. .IP \(bu 2
  423. Default: Infinity
  424. .IP \(bu 2
  425. Type: Number
  426. .RE
  427. .P
  428. The depth to go when recursing directories for \fBnpm ls\fP,
  429. \fBnpm cache ls\fP, and \fBnpm outdated\fP\|\.
  430. .P
  431. For \fBnpm outdated\fP, a setting of \fBInfinity\fP will be treated as \fB0\fP
  432. since that gives more useful information\. To show the outdated status
  433. of all packages and dependents, use a large integer value,
  434. e\.g\., \fBnpm outdated \-\-depth 9999\fP
  435. .SS description
  436. .RS 0
  437. .IP \(bu 2
  438. Default: true
  439. .IP \(bu 2
  440. Type: Boolean
  441. .RE
  442. .P
  443. Show the description in \fBnpm search\fP
  444. .SS dev
  445. .RS 0
  446. .IP \(bu 2
  447. Default: false
  448. .IP \(bu 2
  449. Type: Boolean
  450. .RE
  451. .P
  452. Install \fBdev\-dependencies\fP along with packages\.
  453. .SS dry\-run
  454. .RS 0
  455. .IP \(bu 2
  456. Default: false
  457. .IP \(bu 2
  458. Type: Boolean
  459. .RE
  460. .P
  461. Indicates that you don't want npm to make any changes and that it should
  462. only report what it would have done\. This can be passed into any of the
  463. commands that modify your local installation, eg, \fBinstall\fP, \fBupdate\fP,
  464. \fBdedupe\fP, \fBuninstall\fP\|\. This is NOT currently honored by some network related
  465. commands, eg \fBdist\-tags\fP, \fBowner\fP, etc\.
  466. .SS editor
  467. .RS 0
  468. .IP \(bu 2
  469. Default: \fBEDITOR\fP environment variable if set, or \fB"vi"\fP on Posix,
  470. or \fB"notepad"\fP on Windows\.
  471. .IP \(bu 2
  472. Type: path
  473. .RE
  474. .P
  475. The command to run for \fBnpm edit\fP or \fBnpm config edit\fP\|\.
  476. .SS engine\-strict
  477. .RS 0
  478. .IP \(bu 2
  479. Default: false
  480. .IP \(bu 2
  481. Type: Boolean
  482. .RE
  483. .P
  484. If set to true, then npm will stubbornly refuse to install (or even
  485. consider installing) any package that claims to not be compatible with
  486. the current Node\.js version\.
  487. .SS force
  488. .RS 0
  489. .IP \(bu 2
  490. Default: false
  491. .IP \(bu 2
  492. Type: Boolean
  493. .RE
  494. .P
  495. Makes various commands more forceful\.
  496. .RS 0
  497. .IP \(bu 2
  498. lifecycle script failure does not block progress\.
  499. .IP \(bu 2
  500. publishing clobbers previously published versions\.
  501. .IP \(bu 2
  502. skips cache when requesting from the registry\.
  503. .IP \(bu 2
  504. prevents checks against clobbering non\-npm files\.
  505. .RE
  506. .SS format\-package\-lock
  507. .RS 0
  508. .IP \(bu 2
  509. Default: true
  510. .IP \(bu 2
  511. Type: Boolean
  512. .RE
  513. .P
  514. Format \fBpackage\-lock\.json\fP or \fBnpm\-shrinkwrap\.json\fP as a human readable file\.
  515. .SS fetch\-retries
  516. .RS 0
  517. .IP \(bu 2
  518. Default: 2
  519. .IP \(bu 2
  520. Type: Number
  521. .RE
  522. .P
  523. The "retries" config for the \fBretry\fP module to use when fetching
  524. packages from the registry\.
  525. .SS fetch\-retry\-factor
  526. .RS 0
  527. .IP \(bu 2
  528. Default: 10
  529. .IP \(bu 2
  530. Type: Number
  531. .RE
  532. .P
  533. The "factor" config for the \fBretry\fP module to use when fetching
  534. packages\.
  535. .SS fetch\-retry\-mintimeout
  536. .RS 0
  537. .IP \(bu 2
  538. Default: 10000 (10 seconds)
  539. .IP \(bu 2
  540. Type: Number
  541. .RE
  542. .P
  543. The "minTimeout" config for the \fBretry\fP module to use when fetching
  544. packages\.
  545. .SS fetch\-retry\-maxtimeout
  546. .RS 0
  547. .IP \(bu 2
  548. Default: 60000 (1 minute)
  549. .IP \(bu 2
  550. Type: Number
  551. .RE
  552. .P
  553. The "maxTimeout" config for the \fBretry\fP module to use when fetching
  554. packages\.
  555. .SS fund
  556. .RS 0
  557. .IP \(bu 2
  558. Default: true
  559. .IP \(bu 2
  560. Type: Boolean
  561. .RE
  562. .P
  563. When "true" displays the message at the end of each \fBnpm install\fP
  564. acknowledging the number of dependencies looking for funding\.
  565. See npm help \fBfund\fP for details\.
  566. .SS git
  567. .RS 0
  568. .IP \(bu 2
  569. Default: \fB"git"\fP
  570. .IP \(bu 2
  571. Type: String
  572. .RE
  573. .P
  574. The command to use for git commands\. If git is installed on the
  575. computer, but is not in the \fBPATH\fP, then set this to the full path to
  576. the git binary\.
  577. .SS git\-tag\-version
  578. .RS 0
  579. .IP \(bu 2
  580. Default: \fBtrue\fP
  581. .IP \(bu 2
  582. Type: Boolean
  583. .RE
  584. .P
  585. Tag the commit when using the \fBnpm version\fP command\.
  586. .SS commit\-hooks
  587. .RS 0
  588. .IP \(bu 2
  589. Default: \fBtrue\fP
  590. .IP \(bu 2
  591. Type: Boolean
  592. .RE
  593. .P
  594. Run git commit hooks when using the \fBnpm version\fP command\.
  595. .SS global
  596. .RS 0
  597. .IP \(bu 2
  598. Default: false
  599. .IP \(bu 2
  600. Type: Boolean
  601. .RE
  602. .P
  603. Operates in "global" mode, so that packages are installed into the
  604. \fBprefix\fP folder instead of the current working directory\. See
  605. npm help folders for more on the differences in behavior\.
  606. .RS 0
  607. .IP \(bu 2
  608. packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead of the
  609. current working directory\.
  610. .IP \(bu 2
  611. bin files are linked to \fB{prefix}/bin\fP
  612. .IP \(bu 2
  613. man pages are linked to \fB{prefix}/share/man\fP
  614. .RE
  615. .SS globalconfig
  616. .RS 0
  617. .IP \(bu 2
  618. Default: {prefix}/etc/npmrc
  619. .IP \(bu 2
  620. Type: path
  621. .RE
  622. .P
  623. The config file to read for global config options\.
  624. .SS global\-style
  625. .RS 0
  626. .IP \(bu 2
  627. Default: false
  628. .IP \(bu 2
  629. Type: Boolean
  630. .RE
  631. .P
  632. Causes npm to install the package into your local \fBnode_modules\fP folder with
  633. the same layout it uses with the global \fBnode_modules\fP folder\. Only your
  634. direct dependencies will show in \fBnode_modules\fP and everything they depend
  635. on will be flattened in their \fBnode_modules\fP folders\. This obviously will
  636. eliminate some deduping\. If used with \fBlegacy\-bundling\fP, \fBlegacy\-bundling\fP will be
  637. preferred\.
  638. .SS group
  639. .RS 0
  640. .IP \(bu 2
  641. Default: GID of the current process
  642. .IP \(bu 2
  643. Type: String or Number
  644. .RE
  645. .P
  646. The group to use when running package scripts in global mode as the root
  647. user\.
  648. .SS heading
  649. .RS 0
  650. .IP \(bu 2
  651. Default: \fB"npm"\fP
  652. .IP \(bu 2
  653. Type: String
  654. .RE
  655. .P
  656. The string that starts all the debugging log output\.
  657. .SS https\-proxy
  658. .RS 0
  659. .IP \(bu 2
  660. Default: null
  661. .IP \(bu 2
  662. Type: url
  663. .RE
  664. .P
  665. A proxy to use for outgoing https requests\. If the \fBHTTPS_PROXY\fP or
  666. \fBhttps_proxy\fP or \fBHTTP_PROXY\fP or \fBhttp_proxy\fP environment variables are set,
  667. proxy settings will be honored by the underlying \fBrequest\fP library\.
  668. .SS if\-present
  669. .RS 0
  670. .IP \(bu 2
  671. Default: false
  672. .IP \(bu 2
  673. Type: Boolean
  674. .RE
  675. .P
  676. If true, npm will not exit with an error code when \fBrun\-script\fP is invoked for
  677. a script that isn't defined in the \fBscripts\fP section of \fBpackage\.json\fP\|\. This
  678. option can be used when it's desirable to optionally run a script when it's
  679. present and fail if the script fails\. This is useful, for example, when running
  680. scripts that may only apply for some builds in an otherwise generic CI setup\.
  681. .SS ignore\-prepublish
  682. .RS 0
  683. .IP \(bu 2
  684. Default: false
  685. .IP \(bu 2
  686. Type: Boolean
  687. .RE
  688. .P
  689. If true, npm will not run \fBprepublish\fP scripts\.
  690. .SS ignore\-scripts
  691. .RS 0
  692. .IP \(bu 2
  693. Default: false
  694. .IP \(bu 2
  695. Type: Boolean
  696. .RE
  697. .P
  698. If true, npm does not run scripts specified in package\.json files\.
  699. .SS init\-module
  700. .RS 0
  701. .IP \(bu 2
  702. Default: ~/\.npm\-init\.js
  703. .IP \(bu 2
  704. Type: path
  705. .RE
  706. .P
  707. A module that will be loaded by the \fBnpm init\fP command\. See the
  708. documentation for the
  709. init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module
  710. for more information, or npm help init\.
  711. .SS init\-author\-name
  712. .RS 0
  713. .IP \(bu 2
  714. Default: ""
  715. .IP \(bu 2
  716. Type: String
  717. .RE
  718. .P
  719. The value \fBnpm init\fP should use by default for the package author's name\.
  720. .SS init\-author\-email
  721. .RS 0
  722. .IP \(bu 2
  723. Default: ""
  724. .IP \(bu 2
  725. Type: String
  726. .RE
  727. .P
  728. The value \fBnpm init\fP should use by default for the package author's email\.
  729. .SS init\-author\-url
  730. .RS 0
  731. .IP \(bu 2
  732. Default: ""
  733. .IP \(bu 2
  734. Type: String
  735. .RE
  736. .P
  737. The value \fBnpm init\fP should use by default for the package author's homepage\.
  738. .SS init\-license
  739. .RS 0
  740. .IP \(bu 2
  741. Default: "ISC"
  742. .IP \(bu 2
  743. Type: String
  744. .RE
  745. .P
  746. The value \fBnpm init\fP should use by default for the package license\.
  747. .SS init\-version
  748. .RS 0
  749. .IP \(bu 2
  750. Default: "1\.0\.0"
  751. .IP \(bu 2
  752. Type: semver
  753. .RE
  754. .P
  755. The value that \fBnpm init\fP should use by default for the package
  756. version number, if not already set in package\.json\.
  757. .SS json
  758. .RS 0
  759. .IP \(bu 2
  760. Default: false
  761. .IP \(bu 2
  762. Type: Boolean
  763. .RE
  764. .P
  765. Whether or not to output JSON data, rather than the normal output\.
  766. .P
  767. This feature is currently experimental, and the output data structures for many
  768. commands is either not implemented in JSON yet, or subject to change\. Only the
  769. output from \fBnpm ls \-\-json\fP and \fBnpm search \-\-json\fP are currently valid\.
  770. .SS key
  771. .RS 0
  772. .IP \(bu 2
  773. Default: \fBnull\fP
  774. .IP \(bu 2
  775. Type: String
  776. .RE
  777. .P
  778. A client key to pass when accessing the registry\. Values should be in PEM
  779. format with newlines replaced by the string "\\n"\. For example:
  780. .P
  781. .RS 2
  782. .nf
  783. key="\-\-\-\-\-BEGIN PRIVATE KEY\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END PRIVATE KEY\-\-\-\-\-"
  784. .fi
  785. .RE
  786. .P
  787. It is \fInot\fR the path to a key file (and there is no "keyfile" option)\.
  788. .SS legacy\-bundling
  789. .RS 0
  790. .IP \(bu 2
  791. Default: false
  792. .IP \(bu 2
  793. Type: Boolean
  794. .RE
  795. .P
  796. Causes npm to install the package such that versions of npm prior to 1\.4,
  797. such as the one included with node 0\.8, can install the package\. This
  798. eliminates all automatic deduping\. If used with \fBglobal\-style\fP this option
  799. will be preferred\.
  800. .SS link
  801. .RS 0
  802. .IP \(bu 2
  803. Default: false
  804. .IP \(bu 2
  805. Type: Boolean
  806. .RE
  807. .P
  808. If true, then local installs will link if there is a suitable globally
  809. installed package\.
  810. .P
  811. Note that this means that local installs can cause things to be
  812. installed into the global space at the same time\. The link is only done
  813. if one of the two conditions are met:
  814. .RS 0
  815. .IP \(bu 2
  816. The package is not already installed globally, or
  817. .IP \(bu 2
  818. the globally installed version is identical to the version that is
  819. being installed locally\.
  820. .RE
  821. .SS local\-address
  822. .RS 0
  823. .IP \(bu 2
  824. Default: undefined
  825. .IP \(bu 2
  826. Type: IP Address
  827. .RE
  828. .P
  829. The IP address of the local interface to use when making connections
  830. to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\.
  831. .SS loglevel
  832. .RS 0
  833. .IP \(bu 2
  834. Default: "notice"
  835. .IP \(bu 2
  836. Type: String
  837. .IP \(bu 2
  838. Values: "silent", "error", "warn", "notice", "http", "timing", "info",
  839. "verbose", "silly"
  840. .RE
  841. .P
  842. What level of logs to report\. On failure, \fIall\fR logs are written to
  843. \fBnpm\-debug\.log\fP in the current working directory\.
  844. .P
  845. Any logs of a higher level than the setting are shown\. The default is "notice"\.
  846. .SS logstream
  847. .RS 0
  848. .IP \(bu 2
  849. Default: process\.stderr
  850. .IP \(bu 2
  851. Type: Stream
  852. .RE
  853. .P
  854. This is the stream that is passed to the
  855. npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\.
  856. .P
  857. It cannot be set from the command line, but if you are using npm
  858. programmatically, you may wish to send logs to somewhere other than
  859. stderr\.
  860. .P
  861. If the \fBcolor\fP config is set to true, then this stream will receive
  862. colored output if it is a TTY\.
  863. .SS logs\-max
  864. .RS 0
  865. .IP \(bu 2
  866. Default: 10
  867. .IP \(bu 2
  868. Type: Number
  869. .RE
  870. .P
  871. The maximum number of log files to store\.
  872. .SS long
  873. .RS 0
  874. .IP \(bu 2
  875. Default: false
  876. .IP \(bu 2
  877. Type: Boolean
  878. .RE
  879. .P
  880. Show extended information in \fBnpm ls\fP and \fBnpm search\fP\|\.
  881. .SS maxsockets
  882. .RS 0
  883. .IP \(bu 2
  884. Default: 50
  885. .IP \(bu 2
  886. Type: Number
  887. .RE
  888. .P
  889. The maximum number of connections to use per origin (protocol/host/port
  890. combination)\. Passed to the \fBhttp\fP \fBAgent\fP used to make the request\.
  891. .SS message
  892. .RS 0
  893. .IP \(bu 2
  894. Default: "%s"
  895. .IP \(bu 2
  896. Type: String
  897. .RE
  898. .P
  899. Commit message which is used by \fBnpm version\fP when creating version commit\.
  900. .P
  901. Any "%s" in the message will be replaced with the version number\.
  902. .SS metrics\-registry
  903. .RS 0
  904. .IP \(bu 2
  905. Default: The value of \fBregistry\fP (which defaults to "https://registry\.npmjs\.org/")
  906. .IP \(bu 2
  907. Type: String
  908. .RE
  909. .P
  910. The registry you want to send cli metrics to if \fBsend\-metrics\fP is true\.
  911. .SS node\-options
  912. .RS 0
  913. .IP \(bu 2
  914. Default: null
  915. .IP \(bu 2
  916. Type: String
  917. .RE
  918. .P
  919. Options to pass through to Node\.js via the \fBNODE_OPTIONS\fP environment
  920. variable\. This does not impact how npm itself is executed but it does
  921. impact how lifecycle scripts are called\.
  922. .SS node\-version
  923. .RS 0
  924. .IP \(bu 2
  925. Default: process\.version
  926. .IP \(bu 2
  927. Type: semver or false
  928. .RE
  929. .P
  930. The node version to use when checking a package's \fBengines\fP map\.
  931. .SS noproxy
  932. .RS 0
  933. .IP \(bu 2
  934. Default: null
  935. .IP \(bu 2
  936. Type: String or Array
  937. .RE
  938. .P
  939. A comma\-separated string or an array of domain extensions that a proxy should not be used for\.
  940. .SS offline
  941. .RS 0
  942. .IP \(bu 2
  943. Default: false
  944. .IP \(bu 2
  945. Type: Boolean
  946. .RE
  947. .P
  948. Force offline mode: no network requests will be done during install\. To allow
  949. the CLI to fill in missing cache data, see \fB\-\-prefer\-offline\fP\|\.
  950. .SS onload\-script
  951. .RS 0
  952. .IP \(bu 2
  953. Default: false
  954. .IP \(bu 2
  955. Type: path
  956. .RE
  957. .P
  958. A node module to \fBrequire()\fP when npm loads\. Useful for programmatic
  959. usage\.
  960. .SS only
  961. .RS 0
  962. .IP \(bu 2
  963. Default: null
  964. .IP \(bu 2
  965. Type: String
  966. .RE
  967. .P
  968. When "dev" or "development" and running local \fBnpm install\fP without any
  969. arguments, only devDependencies (and their dependencies) are installed\.
  970. .P
  971. When "dev" or "development" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or
  972. \fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\.
  973. .P
  974. When "prod" or "production" and running local \fBnpm install\fP without any
  975. arguments, only non\-devDependencies (and their dependencies) are
  976. installed\.
  977. .P
  978. When "prod" or "production" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or
  979. \fBnpm update\fP, is an alias for \fB\-\-production\fP\|\.
  980. .SS optional
  981. .RS 0
  982. .IP \(bu 2
  983. Default: true
  984. .IP \(bu 2
  985. Type: Boolean
  986. .RE
  987. .P
  988. Attempt to install packages in the \fBoptionalDependencies\fP object\. Note
  989. that if these packages fail to install, the overall installation
  990. process is not aborted\.
  991. .SS otp
  992. .RS 0
  993. .IP \(bu 2
  994. Default: null
  995. .IP \(bu 2
  996. Type: Number
  997. .RE
  998. .P
  999. This is a one\-time password from a two\-factor authenticator\. It's needed
  1000. when publishing or changing package permissions with \fBnpm access\fP\|\.
  1001. .SS package\-lock
  1002. .RS 0
  1003. .IP \(bu 2
  1004. Default: true
  1005. .IP \(bu 2
  1006. Type: Boolean
  1007. .RE
  1008. .P
  1009. If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This
  1010. will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\.
  1011. .P
  1012. When package package\-locks are disabled, automatic pruning of extraneous
  1013. modules will also be disabled\. To remove extraneous modules with
  1014. package\-locks disabled use \fBnpm prune\fP\|\.
  1015. .P
  1016. This option is an alias for \fB\-\-shrinkwrap\fP\|\.
  1017. .SS package\-lock\-only
  1018. .RS 0
  1019. .IP \(bu 2
  1020. Default: false
  1021. .IP \(bu 2
  1022. Type: Boolean
  1023. .RE
  1024. .P
  1025. If set to true, it will update only the \fBpackage\-lock\.json\fP,
  1026. instead of checking \fBnode_modules\fP and downloading dependencies\.
  1027. .SS parseable
  1028. .RS 0
  1029. .IP \(bu 2
  1030. Default: false
  1031. .IP \(bu 2
  1032. Type: Boolean
  1033. .RE
  1034. .P
  1035. Output parseable results from commands that write to
  1036. standard output\. For \fBnpm search\fP, this will be tab\-separated table format\.
  1037. .SS prefer\-offline
  1038. .RS 0
  1039. .IP \(bu 2
  1040. Default: false
  1041. .IP \(bu 2
  1042. Type: Boolean
  1043. .RE
  1044. .P
  1045. If true, staleness checks for cached data will be bypassed, but missing data
  1046. will be requested from the server\. To force full offline mode, use \fB\-\-offline\fP\|\.
  1047. .P
  1048. This option is effectively equivalent to \fB\-\-cache\-min=9999999\fP\|\.
  1049. .SS prefer\-online
  1050. .RS 0
  1051. .IP \(bu 2
  1052. Default: false
  1053. .IP \(bu 2
  1054. Type: Boolean
  1055. .RE
  1056. .P
  1057. If true, staleness checks for cached data will be forced, making the CLI look
  1058. for updates immediately even for fresh package data\.
  1059. .SS prefix
  1060. .RS 0
  1061. .IP \(bu 2
  1062. Default: see npm help folders
  1063. .IP \(bu 2
  1064. Type: path
  1065. .RE
  1066. .P
  1067. The location to install global items\. If set on the command line, then
  1068. it forces non\-global commands to run in the specified folder\.
  1069. .SS preid
  1070. .RS 0
  1071. .IP \(bu 2
  1072. Default: ""
  1073. .IP \(bu 2
  1074. Type: String
  1075. .RE
  1076. .P
  1077. The "prerelease identifier" to use as a prefix for the "prerelease" part of a
  1078. semver\. Like the \fBrc\fP in \fB1\.2\.0\-rc\.8\fP\|\.
  1079. .SS production
  1080. .RS 0
  1081. .IP \(bu 2
  1082. Default: false
  1083. .IP \(bu 2
  1084. Type: Boolean
  1085. .RE
  1086. .P
  1087. Set to true to run in "production" mode\.
  1088. .RS 0
  1089. .IP 1. 3
  1090. devDependencies are not installed at the topmost level when running
  1091. local \fBnpm install\fP without any arguments\.
  1092. .IP 2. 3
  1093. Set the NODE_ENV="production" for lifecycle scripts\.
  1094. .RE
  1095. .SS progress
  1096. .RS 0
  1097. .IP \(bu 2
  1098. Default: true, unless TRAVIS or CI env vars set\.
  1099. .IP \(bu 2
  1100. Type: Boolean
  1101. .RE
  1102. .P
  1103. When set to \fBtrue\fP, npm will display a progress bar during time intensive
  1104. operations, if \fBprocess\.stderr\fP is a TTY\.
  1105. .P
  1106. Set to \fBfalse\fP to suppress the progress bar\.
  1107. .SS proxy
  1108. .RS 0
  1109. .IP \(bu 2
  1110. Default: null
  1111. .IP \(bu 2
  1112. Type: url
  1113. .RE
  1114. .P
  1115. A proxy to use for outgoing http requests\. If the \fBHTTP_PROXY\fP or
  1116. \fBhttp_proxy\fP environment variables are set, proxy settings will be
  1117. honored by the underlying \fBrequest\fP library\.
  1118. .SS read\-only
  1119. .RS 0
  1120. .IP \(bu 2
  1121. Default: false
  1122. .IP \(bu 2
  1123. Type: Boolean
  1124. .RE
  1125. .P
  1126. This is used to mark a token as unable to publish when configuring limited access tokens with the \fBnpm token create\fP command\.
  1127. .SS rebuild\-bundle
  1128. .RS 0
  1129. .IP \(bu 2
  1130. Default: true
  1131. .IP \(bu 2
  1132. Type: Boolean
  1133. .RE
  1134. .P
  1135. Rebuild bundled dependencies after installation\.
  1136. .SS registry
  1137. .RS 0
  1138. .IP \(bu 2
  1139. Default: https://registry\.npmjs\.org/
  1140. .IP \(bu 2
  1141. Type: url
  1142. .RE
  1143. .P
  1144. The base URL of the npm package registry\.
  1145. .SS rollback
  1146. .RS 0
  1147. .IP \(bu 2
  1148. Default: true
  1149. .IP \(bu 2
  1150. Type: Boolean
  1151. .RE
  1152. .P
  1153. Remove failed installs\.
  1154. .SS save
  1155. .RS 0
  1156. .IP \(bu 2
  1157. Default: true
  1158. .IP \(bu 2
  1159. Type: Boolean
  1160. .RE
  1161. .P
  1162. Save installed packages to a package\.json file as dependencies\.
  1163. .P
  1164. When used with the \fBnpm rm\fP command, it removes it from the \fBdependencies\fP
  1165. object\.
  1166. .P
  1167. Only works if there is already a package\.json file present\.
  1168. .SS save\-bundle
  1169. .RS 0
  1170. .IP \(bu 2
  1171. Default: false
  1172. .IP \(bu 2
  1173. Type: Boolean
  1174. .RE
  1175. .P
  1176. If a package would be saved at install time by the use of \fB\-\-save\fP,
  1177. \fB\-\-save\-dev\fP, or \fB\-\-save\-optional\fP, then also put it in the
  1178. \fBbundleDependencies\fP list\.
  1179. .P
  1180. When used with the \fBnpm rm\fP command, it removes it from the
  1181. bundledDependencies list\.
  1182. .SS save\-prod
  1183. .RS 0
  1184. .IP \(bu 2
  1185. Default: false
  1186. .IP \(bu 2
  1187. Type: Boolean
  1188. .RE
  1189. .P
  1190. Makes sure that a package will be saved into \fBdependencies\fP specifically\. This
  1191. is useful if a package already exists in \fBdevDependencies\fP or
  1192. \fBoptionalDependencies\fP, but you want to move it to be a production dep\. This is
  1193. also the default behavior if \fB\-\-save\fP is true, and neither \fB\-\-save\-dev\fP or
  1194. \fB\-\-save\-optional\fP are true\.
  1195. .SS save\-dev
  1196. .RS 0
  1197. .IP \(bu 2
  1198. Default: false
  1199. .IP \(bu 2
  1200. Type: Boolean
  1201. .RE
  1202. .P
  1203. Save installed packages to a package\.json file as \fBdevDependencies\fP\|\.
  1204. .P
  1205. When used with the \fBnpm rm\fP command, it removes it from the
  1206. \fBdevDependencies\fP object\.
  1207. .P
  1208. Only works if there is already a package\.json file present\.
  1209. .SS save\-exact
  1210. .RS 0
  1211. .IP \(bu 2
  1212. Default: false
  1213. .IP \(bu 2
  1214. Type: Boolean
  1215. .RE
  1216. .P
  1217. Dependencies saved to package\.json using \fB\-\-save\fP, \fB\-\-save\-dev\fP or
  1218. \fB\-\-save\-optional\fP will be configured with an exact version rather than
  1219. using npm's default semver range operator\.
  1220. .SS save\-optional
  1221. .RS 0
  1222. .IP \(bu 2
  1223. Default: false
  1224. .IP \(bu 2
  1225. Type: Boolean
  1226. .RE
  1227. .P
  1228. Save installed packages to a package\.json file as
  1229. optionalDependencies\.
  1230. .P
  1231. When used with the \fBnpm rm\fP command, it removes it from the
  1232. \fBdevDependencies\fP object\.
  1233. .P
  1234. Only works if there is already a package\.json file present\.
  1235. .SS save\-prefix
  1236. .RS 0
  1237. .IP \(bu 2
  1238. Default: '^'
  1239. .IP \(bu 2
  1240. Type: String
  1241. .RE
  1242. .P
  1243. Configure how versions of packages installed to a package\.json file via
  1244. \fB\-\-save\fP or \fB\-\-save\-dev\fP get prefixed\.
  1245. .P
  1246. For example if a package has version \fB1\.2\.3\fP, by default its version is
  1247. set to \fB^1\.2\.3\fP which allows minor upgrades for that package, but after
  1248. \fBnpm config set save\-prefix='~'\fP it would be set to \fB~1\.2\.3\fP which only allows
  1249. patch upgrades\.
  1250. .SS scope
  1251. .RS 0
  1252. .IP \(bu 2
  1253. Default: the scope of the current project, if any, or ""
  1254. .IP \(bu 2
  1255. Type: String
  1256. .RE
  1257. .P
  1258. Associate an operation with a scope for a scoped registry\. Useful when logging
  1259. in to a private registry for the first time:
  1260. \fBnpm login \-\-scope=@organization \-\-registry=registry\.organization\.com\fP, which
  1261. will cause \fB@organization\fP to be mapped to the registry for future installation
  1262. of packages specified according to the pattern \fB@organization/package\fP\|\.
  1263. .SS script\-shell
  1264. .RS 0
  1265. .IP \(bu 2
  1266. Default: \fBnull\fP
  1267. .IP \(bu 2
  1268. Type: path
  1269. .RE
  1270. .P
  1271. The shell to use for scripts run with the \fBnpm run\fP command\.
  1272. .SS scripts\-prepend\-node\-path
  1273. .RS 0
  1274. .IP \(bu 2
  1275. Default: "warn\-only"
  1276. .IP \(bu 2
  1277. Type: Boolean, \fB"auto"\fP or \fB"warn\-only"\fP
  1278. .RE
  1279. .P
  1280. If set to \fBtrue\fP, add the directory in which the current \fBnode\fP executable
  1281. resides to the \fBPATH\fP environment variable when running scripts,
  1282. even if that means that \fBnpm\fP will invoke a different \fBnode\fP executable than
  1283. the one which it is running\.
  1284. .P
  1285. If set to \fBfalse\fP, never modify \fBPATH\fP with that\.
  1286. .P
  1287. If set to \fB"warn\-only"\fP, never modify \fBPATH\fP but print a warning if \fBnpm\fP thinks
  1288. that you may want to run it with \fBtrue\fP, e\.g\. because the \fBnode\fP executable
  1289. in the \fBPATH\fP is not the one \fBnpm\fP was invoked with\.
  1290. .P
  1291. If set to \fBauto\fP, only add that directory to the \fBPATH\fP environment variable
  1292. if the \fBnode\fP executable with which \fBnpm\fP was invoked and the one that is found
  1293. first on the \fBPATH\fP are different\.
  1294. .SS searchexclude
  1295. .RS 0
  1296. .IP \(bu 2
  1297. Default: ""
  1298. .IP \(bu 2
  1299. Type: String
  1300. .RE
  1301. .P
  1302. Space\-separated options that limit the results from search\.
  1303. .SS searchopts
  1304. .RS 0
  1305. .IP \(bu 2
  1306. Default: ""
  1307. .IP \(bu 2
  1308. Type: String
  1309. .RE
  1310. .P
  1311. Space\-separated options that are always passed to search\.
  1312. .SS searchlimit
  1313. .RS 0
  1314. .IP \(bu 2
  1315. Default: 20
  1316. .IP \(bu 2
  1317. Type: Number
  1318. .RE
  1319. .P
  1320. Number of items to limit search results to\. Will not apply at all to legacy
  1321. searches\.
  1322. .SS searchstaleness
  1323. .RS 0
  1324. .IP \(bu 2
  1325. Default: 900 (15 minutes)
  1326. .IP \(bu 2
  1327. Type: Number
  1328. .RE
  1329. .P
  1330. The age of the cache, in seconds, before another registry request is made if
  1331. using legacy search endpoint\.
  1332. .SS send\-metrics
  1333. .RS 0
  1334. .IP \(bu 2
  1335. Default: false
  1336. .IP \(bu 2
  1337. Type: Boolean
  1338. .RE
  1339. .P
  1340. If true, success/failure metrics will be reported to the registry stored in
  1341. \fBmetrics\-registry\fP\|\. These requests contain the number of successful and
  1342. failing runs of the npm CLI and the time period overwhich those counts were
  1343. gathered\. No identifying information is included in these requests\.
  1344. .SS shell
  1345. .RS 0
  1346. .IP \(bu 2
  1347. Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
  1348. Windows
  1349. .IP \(bu 2
  1350. Type: path
  1351. .RE
  1352. .P
  1353. The shell to run for the \fBnpm explore\fP command\.
  1354. .SS shrinkwrap
  1355. .RS 0
  1356. .IP \(bu 2
  1357. Default: true
  1358. .IP \(bu 2
  1359. Type: Boolean
  1360. .RE
  1361. .P
  1362. If set to false, then ignore \fBnpm\-shrinkwrap\.json\fP files when installing\. This
  1363. will also prevent \fIwriting\fR \fBnpm\-shrinkwrap\.json\fP if \fBsave\fP is true\.
  1364. .P
  1365. This option is an alias for \fB\-\-package\-lock\fP\|\.
  1366. .SS sign\-git\-commit
  1367. .RS 0
  1368. .IP \(bu 2
  1369. Default: false
  1370. .IP \(bu 2
  1371. Type: Boolean
  1372. .RE
  1373. .P
  1374. If set to true, then the \fBnpm version\fP command will commit the new package
  1375. version using \fB\-S\fP to add a signature\.
  1376. .P
  1377. Note that git requires you to have set up GPG keys in your git configs
  1378. for this to work properly\.
  1379. .SS sign\-git\-tag
  1380. .RS 0
  1381. .IP \(bu 2
  1382. Default: false
  1383. .IP \(bu 2
  1384. Type: Boolean
  1385. .RE
  1386. .P
  1387. If set to true, then the \fBnpm version\fP command will tag the version
  1388. using \fB\-s\fP to add a signature\.
  1389. .P
  1390. Note that git requires you to have set up GPG keys in your git configs
  1391. for this to work properly\.
  1392. .SS sso\-poll\-frequency
  1393. .RS 0
  1394. .IP \(bu 2
  1395. Default: 500
  1396. .IP \(bu 2
  1397. Type: Number
  1398. .RE
  1399. .P
  1400. When used with SSO\-enabled \fBauth\-type\fPs, configures how regularly the registry
  1401. should be polled while the user is completing authentication\.
  1402. .SS sso\-type
  1403. .RS 0
  1404. .IP \(bu 2
  1405. Default: 'oauth'
  1406. .IP \(bu 2
  1407. Type: 'oauth', 'saml', or null
  1408. .RE
  1409. .P
  1410. If \fB\-\-auth\-type=sso\fP, the type of SSO type to use\.
  1411. .SS strict\-ssl
  1412. .RS 0
  1413. .IP \(bu 2
  1414. Default: true
  1415. .IP \(bu 2
  1416. Type: Boolean
  1417. .RE
  1418. .P
  1419. Whether or not to do SSL key validation when making requests to the
  1420. registry via https\.
  1421. .P
  1422. See also the \fBca\fP config\.
  1423. .SS tag
  1424. .RS 0
  1425. .IP \(bu 2
  1426. Default: latest
  1427. .IP \(bu 2
  1428. Type: String
  1429. .RE
  1430. .P
  1431. If you ask npm to install a package and don't tell it a specific version, then
  1432. it will install the specified tag\.
  1433. .P
  1434. Also the tag that is added to the package@version specified by the \fBnpm
  1435. tag\fP command, if no explicit tag is given\.
  1436. .SS tag\-version\-prefix
  1437. .RS 0
  1438. .IP \(bu 2
  1439. Default: \fB"v"\fP
  1440. .IP \(bu 2
  1441. Type: String
  1442. .RE
  1443. .P
  1444. If set, alters the prefix used when tagging a new version when performing a
  1445. version increment using \fBnpm\-version\fP\|\. To remove the prefix altogether, set it
  1446. to the empty string: \fB""\fP\|\.
  1447. .P
  1448. Because other tools may rely on the convention that npm version tags look like
  1449. \fBv1\.0\.0\fP, \fIonly use this property if it is absolutely necessary\fR\|\. In
  1450. particular, use care when overriding this setting for public packages\.
  1451. .SS timing
  1452. .RS 0
  1453. .IP \(bu 2
  1454. Default: \fBfalse\fP
  1455. .IP \(bu 2
  1456. Type: Boolean
  1457. .RE
  1458. .P
  1459. If true, writes an \fBnpm\-debug\fP log to \fB_logs\fP and timing information to
  1460. \fB_timing\.json\fP, both in your cache\. \fB_timing\.json\fP is a newline delimited
  1461. list of JSON objects\. You can quickly view it with this
  1462. json \fIhttps://www\.npmjs\.com/package/json\fR command line:
  1463. \fBjson \-g < ~/\.npm/_timing\.json\fP\|\.
  1464. .SS tmp
  1465. .RS 0
  1466. .IP \(bu 2
  1467. Default: TMPDIR environment variable, or "/tmp"
  1468. .IP \(bu 2
  1469. Type: path
  1470. .RE
  1471. .P
  1472. Where to store temporary files and folders\. All temp files are deleted
  1473. on success, but left behind on failure for forensic purposes\.
  1474. .SS unicode
  1475. .RS 0
  1476. .IP \(bu 2
  1477. Default: false on windows, true on mac/unix systems with a unicode locale
  1478. .IP \(bu 2
  1479. Type: Boolean
  1480. .RE
  1481. .P
  1482. When set to true, npm uses unicode characters in the tree output\. When
  1483. false, it uses ascii characters to draw trees\.
  1484. .SS unsafe\-perm
  1485. .RS 0
  1486. .IP \(bu 2
  1487. Default: false if running as root, true otherwise
  1488. .IP \(bu 2
  1489. Type: Boolean
  1490. .RE
  1491. .P
  1492. Set to true to suppress the UID/GID switching when running package
  1493. scripts\. If set explicitly to false, then installing as a non\-root user
  1494. will fail\.
  1495. .SS update\-notifier
  1496. .RS 0
  1497. .IP \(bu 2
  1498. Default: true
  1499. .IP \(bu 2
  1500. Type: Boolean
  1501. .RE
  1502. .P
  1503. Set to false to suppress the update notification when using an older
  1504. version of npm than the latest\.
  1505. .SS usage
  1506. .RS 0
  1507. .IP \(bu 2
  1508. Default: false
  1509. .IP \(bu 2
  1510. Type: Boolean
  1511. .RE
  1512. .P
  1513. Set to show short usage output (like the \-H output)
  1514. instead of complete help when doing npm help \fBhelp\fP\|\.
  1515. .SS user
  1516. .RS 0
  1517. .IP \(bu 2
  1518. Default: "nobody"
  1519. .IP \(bu 2
  1520. Type: String or Number
  1521. .RE
  1522. .P
  1523. The UID to set to when running package scripts as root\.
  1524. .SS userconfig
  1525. .RS 0
  1526. .IP \(bu 2
  1527. Default: ~/\.npmrc
  1528. .IP \(bu 2
  1529. Type: path
  1530. .RE
  1531. .P
  1532. The location of user\-level configuration settings\.
  1533. .SS umask
  1534. .RS 0
  1535. .IP \(bu 2
  1536. Default: 022
  1537. .IP \(bu 2
  1538. Type: Octal numeric string in range 0000\.\.0777 (0\.\.511)
  1539. .RE
  1540. .P
  1541. The "umask" value to use when setting the file creation mode on files
  1542. and folders\.
  1543. .P
  1544. Folders and executables are given a mode which is \fB0777\fP masked against
  1545. this value\. Other files are given a mode which is \fB0666\fP masked against
  1546. this value\. Thus, the defaults are \fB0755\fP and \fB0644\fP respectively\.
  1547. .SS user\-agent
  1548. .RS 0
  1549. .IP \(bu 2
  1550. Default: node/{process\.version} {process\.platform} {process\.arch}
  1551. .IP \(bu 2
  1552. Type: String
  1553. .RE
  1554. .P
  1555. Sets a User\-Agent to the request header
  1556. .SS version
  1557. .RS 0
  1558. .IP \(bu 2
  1559. Default: false
  1560. .IP \(bu 2
  1561. Type: boolean
  1562. .RE
  1563. .P
  1564. If true, output the npm version and exit successfully\.
  1565. .P
  1566. Only relevant when specified explicitly on the command line\.
  1567. .SS versions
  1568. .RS 0
  1569. .IP \(bu 2
  1570. Default: false
  1571. .IP \(bu 2
  1572. Type: boolean
  1573. .RE
  1574. .P
  1575. If true, output the npm version as well as node's \fBprocess\.versions\fP map, and
  1576. exit successfully\.
  1577. .P
  1578. Only relevant when specified explicitly on the command line\.
  1579. .SS viewer
  1580. .RS 0
  1581. .IP \(bu 2
  1582. Default: "man" on Posix, "browser" on Windows
  1583. .IP \(bu 2
  1584. Type: path
  1585. .RE
  1586. .P
  1587. The program to use to view help content\.
  1588. .P
  1589. Set to \fB"browser"\fP to view html help content in the default web browser\.
  1590. .SS See also
  1591. .RS 0
  1592. .IP \(bu 2
  1593. npm help config
  1594. .IP \(bu 2
  1595. npm help npmrc
  1596. .IP \(bu 2
  1597. npm help scripts
  1598. .IP \(bu 2
  1599. npm help folders
  1600. .IP \(bu 2
  1601. npm help npm
  1602. .RE