Pergunta

I wanted to put a small library code to pub.dartlang.org After calling pub publish, it asked me to Allow accessing my google account for sending files. After I allowed by going to the given browser link, it gave me this error in the command line:

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

here is the --verbose output

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

I am guessing it cannot find the ca-certificates.crt file but not sure why.

Version Info: Dart SDK version 0.2.10.1_r16761 ubuntu linux 12.10 64 bit

Foi útil?

Solução 2

If you run pub on Linux or Mac, it will assume curl is in your PATH and try to spawn it without an explicit path. On Windows, it will use the included curl binary. Our assumption here was that most *NIX users would have curl installed already.

This curl dependency should be going away soon anyway, but I'm glad you found the solution.

Outras dicas

My bad, this was because pub has "curl" dependency. After installing curl I could publish the lib.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top