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

后端 未结 2 539
有刺的猬
有刺的猬 2020-12-09 23:06

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

2条回答
  •  一向
    一向 (楼主)
    2020-12-09 23:36

    Another way to go is using the command line tools for getting the packages:

    (On Windows)

    1. Proxy Settings

      • In the cmd (not persistent):

        SET HTTP_PROXY=proxy:port
        SET HTTPS_PROXY=proxy:port
        
      • Or as Zdeslav Vojkovic suggested - specify system environment variables (persistent).

    2. Go to the sample app folder

      cd \samples\angular_todo\
      
    3. Run the required pub command:

      \dart-sdk\bin\pub.bat get
      

    Project is automatically updated in the dart editor.


    Edit: Try as well setting the proxy information as system environment variables, but using lower case e.g.

    http_proxy=proxy:port
    https_proxy=proxy:port
    

    As far I as know Windows environment variables are not case sensitive. However dart editor seems to make difference.

提交回复
热议问题