1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["24197"],{96769(e,n,s){s.r(n),s.d(n,{metadata:()=>t,default:()=>a,frontMatter:()=>l,contentTitle:()=>o,toc:()=>c,assets:()=>d});var t=JSON.parse('{"id":"settings/network","title":"Network & Request Settings","description":"Network Settings","source":"@site/versioned_docs/version-11.x/settings/network.md","sourceDirName":"settings","slug":"/settings/network","permalink":"/11.x/settings/network","draft":false,"unlisted":false,"editUrl":"https://github.com/pnpm/pnpm.io/edit/main/versioned_docs/version-11.x/settings/network.md","tags":[],"version":"11.x","lastUpdatedBy":"Zoltan Kochan","lastUpdatedAt":1788556519000,"frontMatter":{"id":"network","title":"Network & Request Settings","sidebar_label":"Network & requests"},"sidebar":"docs","previous":{"title":"Store & lockfile","permalink":"/11.x/settings/store"},"next":{"title":"Peer dependencies","permalink":"/11.x/settings/peer-dependencies"}}'),r=s(91987),i=s(67008);let l={id:"network",title:"Network & Request Settings",sidebar_label:"Network & requests"},o,d={},c=[{value:"Network Settings",id:"network-settings",level:2},{value:"httpsProxy",id:"httpsproxy",level:3},{value:"httpProxy",id:"httpproxy",level:3},{value:"noProxy",id:"noproxy",level:3},{value:"localAddress",id:"localaddress",level:3},{value:"maxsockets",id:"maxsockets",level:3},{value:"strictSsl",id:"strictssl",level:3},{value:"Request Settings",id:"request-settings",level:2},{value:"gitShallowHosts",id:"gitshallowhosts",level:3},{value:"networkConcurrency",id:"networkconcurrency",level:3},{value:"fetchRetries",id:"fetchretries",level:3},{value:"fetchRetryFactor",id:"fetchretryfactor",level:3},{value:"fetchRetryMintimeout",id:"fetchretrymintimeout",level:3},{value:"fetchRetryMaxtimeout",id:"fetchretrymaxtimeout",level:3},{value:"fetchTimeout",id:"fetchtimeout",level:3},{value:"fetchWarnTimeoutMs",id:"fetchwarntimeoutms",level:3},{value:"fetchMinSpeedKiBps",id:"fetchminspeedkibps",level:3}];function h(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"network-settings",children:"Network Settings"}),"\n",(0,r.jsx)(n.h3,{id:"httpsproxy",children:"httpsProxy"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"null"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"url"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["A proxy to use for outgoing HTTPS requests. If the ",(0,r.jsx)(n.code,{children:"HTTPS_PROXY"}),", ",(0,r.jsx)(n.code,{children:"https_proxy"}),",\n",(0,r.jsx)(n.code,{children:"HTTP_PROXY"})," or ",(0,r.jsx)(n.code,{children:"http_proxy"})," environment variables are set, their values will be\nused instead."]}),"\n",(0,r.jsx)(n.p,{children:"If your proxy URL contains a username and password, make sure to URL-encode them.\nFor instance:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'httpsProxy: "https://use%21r:pas%[email protected]:1234/foo"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["Do not encode the colon (",(0,r.jsx)(n.code,{children:":"}),") between the username and password."]}),"\n",(0,r.jsxs)(n.p,{children:["Since v11.20.0, an empty value reads as unset instead of failing the install with ",(0,r.jsx)(n.code,{children:"ERR_PNPM_INVALID_PROXY"}),", so a shell that exports ",(0,r.jsx)(n.code,{children:"HTTPS_PROXY="})," simply disables the proxy. Setting the value to ",(0,r.jsx)(n.code,{children:"false"})," or ",(0,r.jsx)(n.code,{children:"null"})," in ",(0,r.jsx)(n.code,{children:"pnpm-workspace.yaml"})," or the ",(0,r.jsx)(n.code,{children:".npmrc"})," also turns proxying off. On the command line, ",(0,r.jsx)(n.code,{children:"false"})," and ",(0,r.jsx)(n.code,{children:"null"})," are ordinary host names, since a flag carries its value verbatim."]}),"\n",(0,r.jsx)(n.h3,{id:"httpproxy",children:"httpProxy"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"null"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"url"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["A proxy to use for outgoing HTTP requests. If the ",(0,r.jsx)(n.code,{children:"HTTP_PROXY"})," or ",(0,r.jsx)(n.code,{children:"http_proxy"}),"\nenvironment variables are set, proxy settings will be honored by the underlying\nrequest library."]}),"\n",(0,r.jsxs)(n.p,{children:["Empty, ",(0,r.jsx)(n.code,{children:"false"}),", and ",(0,r.jsx)(n.code,{children:"null"})," values behave as described for ",(0,r.jsx)(n.a,{href:"#httpsproxy",children:(0,r.jsx)(n.code,{children:"httpsProxy"})}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:".npmrc"})," also supports npm's legacy ",(0,r.jsx)(n.code,{children:"proxy"})," setting, which is used as the fallback for both ",(0,r.jsx)(n.code,{children:"https-proxy"})," and ",(0,r.jsx)(n.code,{children:"http-proxy"}),". Since v11.20.0, an empty ",(0,r.jsx)(n.code,{children:"proxy="})," reads as unset and therefore no longer suppresses the ",(0,r.jsx)(n.code,{children:"HTTPS_PROXY"})," environment variable, and ",(0,r.jsx)(n.code,{children:"proxy=false"})," (or ",(0,r.jsx)(n.code,{children:"proxy: false"})," in ",(0,r.jsx)(n.code,{children:"pnpm-workspace.yaml"}),") turns proxying off instead of being read as a proxy host named ",(0,r.jsx)(n.code,{children:"false"})," (",(0,r.jsx)(n.a,{href:"https://github.com/pnpm/pnpm/issues/13533",children:"#13533"}),")."]}),"\n",(0,r.jsx)(n.h3,{id:"noproxy",children:"noProxy"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"null"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"String"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"A comma-separated string of domain extensions that a proxy should not be used for."}),"\n",(0,r.jsxs)(n.p,{children:["Empty, ",(0,r.jsx)(n.code,{children:"false"}),", and ",(0,r.jsx)(n.code,{children:"null"})," values behave as described for ",(0,r.jsx)(n.a,{href:"#httpsproxy",children:(0,r.jsx)(n.code,{children:"httpsProxy"})}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"localaddress",children:"localAddress"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"undefined"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"IP Address"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The IP address of the local interface to use when making connections to the npm\nregistry."}),"\n",(0,r.jsx)(n.h3,{id:"maxsockets",children:"maxsockets"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"networkConcurrency x 3"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The maximum number of connections to use per origin (protocol/host/port combination)."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"maxSockets"})," is accepted as an alias. Both spellings are read from\n",(0,r.jsx)(n.code,{children:"pnpm-workspace.yaml"}),", the global configuration file, the environment, and the\ncommand line, in that increasing order of precedence \u2014 so a value passed on the\ncommand line wins even when the two sides spelled the setting differently."]}),"\n",(0,r.jsx)(n.h3,{id:"strictssl",children:"strictSsl"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"true"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Boolean"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Whether or not to do SSL key validation when making requests to the registry via\nHTTPS."}),"\n",(0,r.jsx)(n.h2,{id:"request-settings",children:"Request Settings"}),"\n",(0,r.jsx)(n.h3,{id:"gitshallowhosts",children:"gitShallowHosts"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"['github.com', 'gist.github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"string[]"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"When fetching dependencies that are Git repositories, if the host is listed in this setting, pnpm will use shallow cloning to fetch only the needed commit, not all the history."}),"\n",(0,r.jsx)(n.h3,{id:"networkconcurrency",children:"networkConcurrency"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"auto (workers \xd7 3 clamped to 16-64)"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Controls the maximum number of HTTP(S) requests to process simultaneously."}
1),"\n",(0,r.jsx)(n.p,{children:"As of v10.24.0, pnpm automatically selects a value between 16 and 64 based on the number of workers (networkConcurrency = clamp(workers \xd7 3, 16, 64)). Set this value explicitly to override the automatic scaling."}),"\n",(0,r.jsx)(n.h3,{id:"fetchretries",children:"fetchRetries"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"2"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"How many times to retry if pnpm fails to fetch from the registry."}),"\n",(0,r.jsx)(n.h3,{id:"fetchretryfactor",children:"fetchRetryFactor"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"10"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The exponential factor for retry backoff."}),"\n",(0,r.jsx)(n.h3,{id:"fetchretrymintimeout",children:"fetchRetryMintimeout"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"10000 (10 seconds)"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The lower bound (in milliseconds) of the retry exponential backoff."}),"\n",(0,r.jsx)(n.h3,{id:"fetchretrymaxtimeout",children:"fetchRetryMaxtimeout"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"60000 (1 minute)"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The upper bound (in milliseconds) of the retry exponential backoff."}),"\n",(0,r.jsx)(n.h3,{id:"fetchtimeout",children:"fetchTimeout"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"60000 (1 minute)"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The maximum amount of time to wait for HTTP requests to connect and complete.\nThis time should be enough to download the largest package over a reasonable connection."}),"\n",(0,r.jsx)(n.h3,{id:"fetchwarntimeoutms",children:"fetchWarnTimeoutMs"}),"\n",(0,r.jsx)(n.p,{children:"Added in: v10.18.0"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"10000 ms (10 seconds)"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"A warning message is displayed if a metadata request to the registry takes longer than the specified threshold (in milliseconds)."}),"\n",(0,r.jsx)(n.h3,{id:"fetchminspeedkibps",children:"fetchMinSpeedKiBps"}),"\n",(0,r.jsx)(n.p,{children:"Added in: v10.18.0"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Default: ",(0,r.jsx)(n.strong,{children:"50 KiB/s"})]}),"\n",(0,r.jsxs)(n.li,{children:["Type: ",(0,r.jsx)(n.strong,{children:"Number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"A warning message is displayed if the download speed of a tarball from the registry falls below the specified threshold (in KiB/s)."})]})}function a(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},67008(e,n,s){s.d(n,{R:()=>l,x:()=>o});var t=s(71763);let r={},i=t.createContext(r);function l(e){let n=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.