Dart pub publish在身份验证后发出错误

时间:2013-01-13 20:23:11

标签: dart dart-pub

我想把一个小的库代码放到pub.dartlang.org 在致电pub pub之后,它要求我允许访问我的Google帐户以发送文件。在我允许转到给定的浏览器链接后,它在命令行中给了我这个错误:

Waiting for your authorization...
Authorization received, processing...
ProcessException: No such file or directory
Command: curl --dump-header /tmp/temp_dir1_CzMqQG/curl-headers --cacert /home/afsina/apps/dart/dart-sdk/util/pub/curl/ca-certificates.crt --request POST --location --max-redirs 5 --data-binary @- --header accept:  --header user-agent:  --header Content-Type: application/x-www-form-urlencoded; charset=UTF-8 --header content-length: 265 https://accounts.google.com/o/oauth2/token

这是--verbose输出

Looks great! Are you ready to upload your package (y/n)? y
IO  : Read line: y
FINE: Loading OAuth2 credentials.
IO  : Seeing if file /home/afsina/.pub-cache/credentials.json exists.
IO  : File /home/afsina/.pub-cache/credentials.json does not exist.
FINE: No credentials found at /home/afsina/.pub-cache/credentials.json.
MSG : Pub needs your authorization to upload packages on your behalf.
    | In a web browser, go to https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&response_type=code&client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A59097&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
    | Then click "Allow access".
    | 
    | Waiting for your authorization...
MSG : Authorization received, processing...
FINE: Sending Curl request POST https://accounts.google.com/o/oauth2/token
IO  : Begin create temp directory .
IO  : End create temp directory .
IO  : Spawning curl --dump-header /tmp/temp_dir1_RpLNu6/curl-headers --cacert /home/afsina/apps/dart/dart-sdk/util/pub/curl/ca-certificates.crt --request POST --location --max-redirs 5 --data-binary @- --header accept:  --header user-agent:  --header Content-Type: application/x-www-form-urlencoded; charset=UTF-8 --header content-length: 265 https://accounts.google.com/o/oauth2/token
IO  : Spawning curl --dump-header /tmp/temp_dir1_RpLNu6/curl-headers --cacert /home/afsina/apps/dart/dart-sdk/util/pub/curl/ca-certificates.crt --request POST --location --max-redirs 5 --data-binary @- --header accept:  --header user-agent:  --header Content-Type: application/x-www-form-urlencoded; charset=UTF-8 --header content-length: 265 https://accounts.google.com/o/oauth2/token
ERR : ProcessException: No such file or directory
    |   Command: curl --dump-header /tmp/temp_dir1_RpLNu6/curl-headers --cacert /home/afsina/apps/dart/dart-sdk/util/pub/curl/ca-certificates.crt --request POST --location --max-redirs 5 --data-binary @- --header accept:  --header user-agent:  --header Content-Type: application/x-www-form-urlencoded; charset=UTF-8 --header content-length: 265 https://accounts.google.com/o/oauth2/token

我猜它找不到ca-certificates.crt文件,但不确定原因。

版本信息:Dart SDK版本0.2.10.1_r16761 ubuntu linux 12.10 64位

2 个答案:

答案 0 :(得分:3)

我的不好,这是因为酒吧有“卷曲”依赖。安装curl后,我可以发布lib。

答案 1 :(得分:1)

如果您在Linux或Mac上运行pub,它会假设curl在您的PATH中并尝试在没有显式路径的情况下生成它。在Windows上,它将使用包含的curl二进制文件。我们的假设是大多数* NIX用户已经安装了curl。

无论如何,这种卷曲依赖应该很快消失,但我很高兴你找到了解决方案。