whyrusleeping / gx

A package management tool
MIT License
1.88k stars 111 forks source link

Can't publish; please run an ipfs node and try again #230

Open anacrolix opened 5 years ago

anacrolix commented 5 years ago
$ gx publish
gx cannot publish using public gateways.
please run an ipfs node and try again.

I am running a node locally, I'm not sure why it's not finding it.

Stebalien commented 5 years ago

What do you get when you run:

> cat "${IPFS_PATH:-~/.ipfs}/api"

?

anacrolix commented 5 years ago

Thanks. My IPFS_PATH was in a non-default location. Running IPFS_PATH=... gx publish worked. Also cat "${IPFS_PATH:-$HOME/.ipfs}/api".

I couldn't find anything about IPFS_PATH in the gx documentation, is this actionable?

Stebalien commented 5 years ago

$IPFS_PATH is how we tell IPFS (and related tools) where the IPFS repo is. It's documented in ipfs -h and ipfs init -h.

However, gx should probably print out something a bit more verbose (e.g., couldn't find some API file/repo).

anacrolix commented 5 years ago

Perhaps also a hint in the CLI UI?

Stebalien commented 5 years ago

I was thinking we should put something in the error message, where in the CLI did you want to put this?

anacrolix commented 5 years ago

Maybe

$ gx publish
local ipfs node not found

gx publish mentions something in its description:

$ gx help publish
NAME:
   gx publish - publish a package

USAGE:
   gx publish [command options] [arguments...]

DESCRIPTION:
   publish a package into ipfs using a locally running daemon. <---

Something like that description belongs in the top level command, deferring all IPFS behaviours to the IPFS standalone command or whatever it uses:

$ gx help
NAME:
   gx - gx is a packaging tool that uses ipfs

USAGE:
   gx [global options] command [command options] [arguments...]

  <something here about delegation to ipfs?>

<snip>
Stebalien commented 5 years ago

The gx publish help text should definitely be more verbose. Most other commands work just fine without the daemon but it couldn't hurt to mention it.

Maybe:

  1. Add a note to see gx help to the gx help publish text.
  2. Add the daemon information to the gx help output.