npm set proxy
访问量: 3485
refer to http://wil.boayue.com/blog/2013/06/14/using-npm-behind-a-proxy/
有时候npm 需要设置代理才能正常安装。光设置 $ export http_proxy=... 不行。所以:
npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080
或者:
npm --https-proxy=http://proxy.company.com:8080 -g install karma
或者执行命令前,
export npm_config_proxy http://proxy.company.com:8080 export npm_config_https_proxy http://proxy.company.com:8080
然后
$ npm install -g mocha --verbose ,
只要看到最后是个 'ok' 就表示成功啦