keybase / node-client

CLI for keybase.io written in/for Node.js
BSD 3-Clause "New" or "Revised" License
300 stars 32 forks source link

`keybase gen` fails if ~/.gnupg dir doesn't exist #202

Open mattrco opened 9 years ago

mattrco commented 9 years ago
$ keybase gen
error: `gpg` exited with code 2
warn: gpg: keyblock resource `/home/matt/.gnupg/secring.gpg': file open error
warn: gpg: keyblock resource `/home/matt/.gnupg/pubring.gpg': file open error
warn: gpg: fatal: /home/matt/.gnupg: directory does not exist!
warn: secmem usage: 0/0 bytes in 0/0 blocks of pool 0/65536

Solved easily by created the dir.

keybase (keybase.io CLI) v0.8.10
- node.js v0.10.25
- gpg (GnuPG) 1.4.18
- Copyright (C) 2014 Free Software Foundation, Inc.
Identifies as: 'keybase.io node.js client v0.8.10 linux'
charego commented 9 years ago

Same here. Went through the Debian/Ubuntu prerequisites to install gnupg and nodejs-legacy, and installed keybase for the first time.

It wasn't just gen, e.g. login and pull expect ~/.gnupg to exist as well.

$ keybase login
Your keybase login passphrase: ********************************
- run scrypt [==================================] 100%
info: Updated file: ~/.cache/keybase/session.json
error: `gpg` exited with code 2
...
warn: gpg: fatal: ~/.gnupg: directory does not exist!

Same versions as OP:

keybase (keybase.io CLI) v0.8.10
- node.js v0.10.25
- gpg (GnuPG) 1.4.18
- Copyright (C) 2014 Free Software Foundation, Inc.
Identifies as: 'keybase.io node.js client v.0.8.10 linux'

https://github.com/keybase/node-client/blob/master/src/env.iced#L234

I've not used CoffeeScript or the "iced" variety. Is there a way to check if exists? before returning (and, if it's false, creating the folder)?

fibo commented 8 years ago

Same happened to me, keybase v0.8.5 and Node v.4.2.2. Just create the folder to fix it.

sinistersig commented 8 years ago

running gpg fixed it for me