ITeye博客

npm proxy setting

cute.spring · 2014-06-29 08:38 · JavaScript · [Node.js · 编程语言 · Markdown

清理 npm config delete http-proxy npm config delete https-proxy

具体设置步骤如下:

  1. 执行
npm config

后, 将看到下一行提示信息

npm config ls -l

to show all defaults.

  1. 执行
npm config ls -l

后,在一大长串的settign中找出userconfig项(大概位于倒数第4项)

[b]userconfig [/b]= "C:\\Users\\USER_NAME\\.npmrc"
  1. 编辑"C:\Users\USER_NAME\.npmrc",
proxy = http://username:password@proxy.company.com:8080
https-proxy = http://username:password@proxy.company.com:8080/

如无须username:password, 可略去,即如下

proxy = http://proxy.company.com:8080
https-proxy = http://proxy.company.com:8080

"保存"后即生效.

参见: http://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy http://wil.boayue.com/blog/2013/06/14/using-npm-behind-a-proxy/

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。