storacha/w3cli

Problem running w3 client

walkerlj0 opened this issue · 5 comments

I installed the @web3-storage/w3cli and @web3-storage/w3up-client & cannot run any of the procesess, not sure what this error message implies:

 ~ w3 up help
file:///usr/local/lib/node_modules/@web3-storage/w3cli/node_modules/@ucanto/transport/src/http.js:30
      throw new TypeError(
            ^

TypeError: ucanto HTTP transport got undefined `fetch`. Try passing in a `fetch` implementation explicitly.
    at Module.open (file:///usr/local/lib/node_modules/@web3-storage/w3cli/node_modules/@ucanto/transport/src/http.js:30:13)
    at file:///usr/local/lib/node_modules/@web3-storage/w3cli/node_modules/@web3-storage/upload-client/src/service.js:13:17
    at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
    at async file:///usr/local/lib/node_modules/@web3-storage/w3cli/shim.js:15:1

I get the same error when running w3 help as well

hi @walkerlj0! thanks for the bug report. could you give us a little more information on how you installed @web3-storage/w3cli and @web3-storage/w3up-client? I just tried to reproduce this and got different results:

➜  w3 up help
The path <elided> does not exist
➜  w3 help

  ERROR
    Invalid command: help

  Run `$ w3 --help` for more info.

➜  w3 --help

  Usage
    $ w3 <command> [options]

  Available Commands
    up                   Store a file(s) to the service and register an upload.
    open                 Open CID on https://w3s.link
    ls                   List uploads in the current space
    rm                   Remove an upload from the uploads listing.
    whoami               Print information about the current agent.
    space                Create and mangage w3 spaces
    space create         Create a new w3 space
    space register       Claim the space by associating it with your email address
    space add            Add a space to the agent.
    space ls             List spaces known to the agent
    space use            Set the current space in use by the agent
    delegation create    Create a delegation to the passed audience for the given abilities with the _current_ space as the resource.
    delegation ls        List delegations created by this agent for others.
    proof add            Add a proof delegated to this agent.
    proof ls             List proofs of capabilities delegated to this agent.
    can store add        Store a CAR file with the service.
    can upload add       Register an upload - a DAG with the given root data CID that is stored in the given CAR shard(s), identified by CAR CIDs.

  For more info, run any command with the `--help` flag
    $ w3 up --help
    $ w3 open --help

  Options
    -v, --version    Displays current version
    -h, --help       Displays this message

  Examples
    $ w3 up path/to/files

does w3 --help work for you?

Hi! I installed it with the command npm install -g @web3-storage/w3cli, however I think I installed a previous, deprecated version of it first from here(https://github.com/web3-storage/w3up-cli), which might have creatred some bad/ conflicting files.

I tried running npm uninstall for that, and also searched around for where the files would be to uninstall that version.

Next I tried installing it with npm install @web3-storage/w3up-client, but now the help command isn't showing anything. Are there environment variables I can change or directories I can check to make sure it was installed correctly?

Screenshot 2023-02-23 at 2 13 51 PM

hm - I think you want @web3-storage/w3cli here: https://github.com/web3-storage/w3cli

if you run

npm install -g @web3-storage/w3cli

it should give you a working w3 command. Let me know if this works for you!

@walkerlj0 I'm going to close this out since I think my solution should fix your problem, please feel free to re-open with an update if it does not!

@walkerlj0 upgrade Node.js to 18+, I hit the same error using Node.js 16