dart pub失败后面的代理 - 有没有办法手动安装软件包? [英] dart pub fail behind a proxy - is there a way to install the packages manually?
问题描述
在使用代理的公司网络中使用Pub dart存在一个已知问题(至少在Windows计算机上)。你甚至不能运行样例,因为他们使用pub来获取包。
如果你首先从没有代理的网络运行这些示例,那么当从代理后面运行它们时,它的工作正常(已经安装了这些包)。
我的问题是:如何手动安装软件包?
我可以从git获取它们,我必须做后来安装他们我困惑的Dart安装目录,用户目录和符号链接似乎是必要的。
感谢,
p>您可以手动下载软件包文件,将它们复制到 packages
文件夹,然后从使用它们的其他地方(在Windows Vista和更高版本,你可以使用 mklink
命令)的符号链接。
更简单的解决方案,如果您可以从没有代理的计算机访问完全安装,则可以使用更简单的解决方案,从那里复制包文件夹。
更简单的是,我有时在我的dropbox文件夹中保存测试项目,所以我只是在我的家用电脑上更新,代理。
话虽如此,我能够通过指定以下系统环境变量来修复代理问题(下面的地址/端口组合,使用正确的您的设置):
HTTP_PROXY:192.168.123.123:1234
HTTPS_PROXY:192.168.123.123:1234
此外,为了使DartEditor能够检查编辑器更新,请在DartEditor.ini文件中添加以下内容: -Dhttp.proxyHost = 192.168.123.123
-Dhttp.proxyPort = 1234
如果你的代理使用身份验证,而不是检查下面的设置(我没有,所以我不能告诉):
-Dhttp.proxyUser = XXX
-Dhttp.proxyPassword = XXX
There is a known issue with using Pub dart in a corporate network using a proxy (on windows machine at least). You cannot even run the samples as they make use of pub to get the packages.
if you run the samples first from a network without a proxy, it works perfectly fine (the packages have been installed) when you run them from behind the proxy.
My question is: how can I install the packages manually?
I can of course get them from git for example, but what do I have to do afterward to "install them" I am confused with what goes in the Dart install directory, the user directory and the symlinks that seem to be necessary.
May be I missed something but I did not find any good doc about that.
thanks,
f.
解决方案 You can download package files manually, copy them to packages
folder and then symlink to it from other places which use them (on Windows Vista and later, you can use mklink
command). You can also just copy them everywhere, instead of symlinking, but that complicates maintenance.
Simpler solution, if you have access to full installation from the machine without proxy, is to copy packages folder from there.
Even simpler, I sometimes keep test projects in my dropbox folder, so i just update when I am on my home computer, and it works fine on my office machine behind the proxy.
That being said, I was able to fix the proxy issue by specifying following system environment variables (address/port combination below is made up, use the correct one for your setup):
HTTP_PROXY: 192.168.123.123:1234
HTTPS_PROXY: 192.168.123.123:1234
in addition, to enable DartEditor to check for editor updates, add following to your DartEditor.ini file:
-Dhttp.proxyHost=192.168.123.123
-Dhttp.proxyPort=1234
If your proxy uses authentication, than check also following settings (mine doesn't so I can't tell):
-Dhttp.proxyUser=XXX
-Dhttp.proxyPassword=XXX
这篇关于dart pub失败后面的代理 - 有没有办法手动安装软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!