RangerMauve / dat-store

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

'dat store add' returns an invalid URL error. #41

Closed engangs closed 4 years ago

engangs commented 4 years ago

Hi all,

I managed to get the systemd script to run, and the status indicates that the service was properly loaded. However, I then tried to add a .dat URL, as follows.

dat store add dat://key

I got the following error. I am pretty sure that the URL is correct because I created it locally. 'dat store list' returns a similar error. Would appreciate any help, thanks!

dat-store add <url|path> [provider]

Add a Dat to your storage provider.

Options:
  --version                  Show version number                       [boolean]
  --help                     Show help                                 [boolean]
  --storage-location         The folder to store dats in
  --port                     The port to use for the HTTP API    [default: 3472]
  --host                     The hostname to make the HTTP server listen on
  --verbose                  Whether the HTTP server should output logs
                                                       [boolean] [default: true]
  --dat-port                 The port to listen for P2P connections on
                                                                 [default: 3282]
  --latest                   Whether to download just the latest changes
                                                      [boolean] [default: false]
  --allow-cors               Allow CORS requests so any website can talk to the
                             store                    [boolean] [default: false]
  --expose-to-internet       Allow connections from the internet, not just the
                             localhost                [boolean] [default: false]
  --authentication-username  Require users to use Basic Auth with this username
                             to connect                   [string] [default: ""]
  --authentication-password  Require users to use Basic Auth with this password
                             to connect                            [default: ""]
  --manifest-timeout         time out if the PDA cannot be read with timeout
                             milliseconds                         [default: 500]

ReferenceError: URL is not defined
    at DatStorageClient._loadPSA (/usr/local/lib/node_modules/dat-store/node_modules/dat-storage-client/index.js:73:21)
    at DatStorageClient._getHref (/usr/local/lib/node_modules/dat-store/node_modules/dat-storage-client/index.js:85:34)
    at DatStorageClient._getDatsPath (/usr/local/lib/node_modules/dat-store/node_modules/dat-storage-client/index.js:103:29)
    at DatStorageClient.add (/usr/local/lib/node_modules/dat-store/node_modules/dat-storage-client/index.js:45:32)
    at StoreClient.add (/usr/local/lib/node_modules/dat-store/client.js:190:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
RangerMauve commented 4 years ago

What version of Node are you using for this? I've tested it with Node 11 and node 12. It seems like your version doesn't have the URL global provided by v8. 🤔