npm设置和取消设置的方法

      发布在:个人笔记      评论:0 条评论
<p>设置</p><p>npm config set proxy=http://127.0.0.1:8087</p><p>npm config set registry=http://registry.npmjs.org</p><p>对应的取消设置</p><p>npm config delete proxy</p><p>npm config delete https-proxy</p><p><br/></p><p style="margin: 10px auto; padding: 0px; list-style: none; font-size: 12px; font-family: 微软雅黑; white-space: normal; background-color: rgb(255, 255, 255);">有些时候npm下载资源出错,再次下载的时候可能因为之前错误的缓存造成一直下载不成功。</p><p style="margin: 10px auto; padding: 0px; list-style: none; font-size: 12px; font-family: 微软雅黑; white-space: normal; background-color: rgb(255, 255, 255);">此时可以清一下npm的缓存,然后尝试重新下载</p><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-size: 12px; font-weight: 600; font-family: &quot;Courier New&quot; !important;">npm cache clean -f</pre><p><br/></p>
相关文章
热门推荐