Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

dart pub fail behind a proxy - is there a way to install the packages manually?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...