我在ionic
中运行了sidetabs
首发系列Windows
并收到此错误
TypeError: You must specify a "protocol" for the proxy type (http, https, socks, socks4, socks4a, socks5, socks5h, pac+data, pac+file, pac+ftp, pac+http, pac+https)
at new ProxyAgent (C:\Users\sato\AppData\Roaming\npm\node_modules\@ionic\cli-plugin-proxy\node_modules\proxy-agent\index.js:97:11)
at ProxyAgent (C:\Users\sato\AppData\Roaming\npm\node_modules\@ionic\cli-plugin-proxy\node_modules\proxy-agent\index.js:81:45)
at Request.proxy (C:\Users\sato\AppData\Roaming\npm\node_modules\@ionic\cli-plugin-proxy\node_modules\superagent-proxy\index.js:71:15)
at C:\Users\sato\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils\lib\http.js:31:17
at Generator.next (<anonymous>)
at fulfilled (C:\Users\sato\AppData\Roaming\npm\node_modules\ionic\node_modules\tslib\tslib.js:102:62)
at <anonymous>
我该如何解决这个问题?
答案 0 :(得分:5)
对于Windows,请输入不带引号的SET
命令。如果文本包含引号,则插件无法从URL识别协议。未来可能会得到修复。截至目前,这对我有用,
set HTTP_PROXY=http://proxy.company.com:port-number
set HTTPS_PROXY=http://proxy.company.com:port-number
set IONIC_HTTP_PROXY=http://proxy.company.com:port-number
set PROXY=http
如果您的代理是HTTP代理,则适用。如果您有SOCK代理,则需要相应地修改更改网址和proxy=sock
答案 1 :(得分:0)
我的问题已通过命令 npm config unset -g proxy
解决。