{"id":667,"date":"2023-02-25T14:01:56","date_gmt":"2023-02-25T06:01:56","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=667"},"modified":"2023-02-26T14:03:48","modified_gmt":"2023-02-26T06:03:48","slug":"npm-yarn-proxy-set-unset","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/npm-yarn-proxy-set-unset\/","title":{"rendered":"npm\u53cayarn\u8bbe\u7f6e\u548c\u53d6\u6d88\u4ee3\u7406\u7684\u65b9\u6cd5"},"content":{"rendered":"<h2>npm\u8bbe\u7f6e\u4ee3\u7406<\/h2>\n<pre><code># npm config set proxy http:\/\/192.168.16.28:8118\n# npm config set https-proxy http:\/\/192.168.16.28:8118\n# npm config set registry=https:\/\/registry.npm.taobao.org\n# npm config ls\n# npm install -g yarn<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u4ee3\u7406\u7528\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<pre><code>npm config set proxy http:\/\/username:password@server:port\nnpm confit set https-proxy http:\/\/username:password@server:port<\/code><\/pre>\n<p>\u6216\u8005\u7f16\u8f91\u7528\u6237\u76ee\u5f55\u4e0b\u7684<code>~\/.npmrc file<\/code><\/p>\n<pre><code>proxy=http:\/\/username:password@host:port\nhttps-proxy=http:\/\/username:password@host:port<\/code><\/pre>\n<h2>npm\u53d6\u6d88\u4ee3\u7406<\/h2>\n<pre><code>npm config delete proxy\nnpm config delete https-proxy<\/code><\/pre>\n<h2>yarn\u4ee3\u7406\u914d\u7f6e<\/h2>\n<pre><code>yarn config set proxy http:\/\/username:password@host:port\nyarn config set https-proxy http:\/\/username:password@host:port<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>npm\u8bbe\u7f6e\u4ee3\u7406 # npm config set proxy http:\/\/192.168.16.28:811 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[188,187,142],"class_list":["post-667","post","type-post","status-publish","format-standard","hentry","category-tools-skills","tag-npm","tag-yarn","tag-142"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=667"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/667\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}