RangerMauve / dat-store

A CLI tool for backing up hyperdrive datasets
GNU Affero General Public License v3.0
59 stars 14 forks source link

The "url" argument must be of type string. Received type object #11

Closed da2x closed 5 years ago

da2x commented 5 years ago
dat store add dat://daniel.priv.no/

TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type object
    at Url.parse (url.js:154:11)
    at urlParse (url.js:148:13)
    at /usr/lib/node_modules/dat-store/node_modules/dat-pinning-service-client/index.js:143:16
    at DatPinningServiceClient.addDat (/usr/lib/node_modules/dat-store/node_modules/dat-pinning-service-client/index.js:90:90)
    at Promise (internal/util.js:275:30)
    at new Promise (<anonymous>)
    at DatPinningServiceClient.addDat (internal/util.js:274:12)
    at StoreClient.callClient (/usr/lib/node_modules/dat-store/client.js:67:48)
    at StoreClient.add (/usr/lib/node_modules/dat-store/client.js:116:17)
    at process._tickCallback (internal/process/next_tick.js:68:7)
RangerMauve commented 5 years ago

What version of dat-store and dat-js do you have?

da2x commented 5 years ago
$ dat -v
> 13.12.2
$ dat store -v
> dat-store add <url>
>
> Add a Dat to your storage provider.
>
> Options:
>  --version  Show version number            [boolean]
>  --help     Show help                      [boolean]
>
> Not enough non-option arguments: got 0, need at least 1
$ dat store --version
> 1.0.2
RangerMauve commented 5 years ago

I think the problem is that you didn't run a store locally and didn't configure a remote store.

I'll add a better error message.

In the meantime, you can run one of the following:

# Run a store in a process
# Will close when you exit
dat store run-service

# Install the store as a service on Linux or Windows
dat store install-service
# You can uninstall it later with
dat store uninstall-service
RangerMauve commented 5 years ago

This should be addressed by https://github.com/datproject/dat-store/commit/27312d7b334f55fe961bfcc06f57b992cbe526c1

da2x commented 5 years ago

If you run dat store then you’re not given any information other than the add command.

RangerMauve commented 5 years ago

That's because the default command is dat store add. Use dat store --help for the full info.

RangerMauve commented 5 years ago

I suggest also going over the README