本文介绍了如何在离子中解决这个错误`你必须指定一个“协议”。代理类型`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 Windows
ionic 启动系列 sidetabs
>并收到此错误
I ran ionic
start series sidetabs
in my Windows
and got this error
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>
我如何解决这个问题?
推荐答案
对于Windows,输入不带引号的 SET
命令。如果文本包含引号,则插件无法从URL识别协议。未来可能会得到修复。截至目前,这对我有用,
For Windows, enter the SET
command without quotes. The plugin cannot identify the protocol from the url if the text contains quotes. Might get fixed in future. As of now, this worked for me,
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
This applies if your proxy is an HTTP proxy. If you have a SOCK proxy, you need to edit accordingly changing the url and proxy=sock
这篇关于如何在离子中解决这个错误`你必须指定一个“协议”。代理类型`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!