hypercore-protocol / cli

A CLI for peer-to-peer file sharing using the Hypercore Protocol.
MIT License
205 stars 17 forks source link

Error while using `sync` to create a drive. #33

Open Octalbyte opened 3 years ago

Octalbyte commented 3 years ago

When I try to create a hyperdrive I get this error: image

I don't now if it's an issue with hyperdrive itself, so I opened it here. I'm running cmd as admin. Os: windows 10 pro.

Michael-S commented 3 years ago

I hit this same error on Windows 10 home. I believe it's caused by https://github.com/hypercore-protocol/cli/blob/master/lib/commands/drive/sync.js#L66 it's using the mkdirp NodeJS package 'sync' command, and according to https://www.npmjs.com/package/mkdirp:

"""windows vs unix caveat

On Windows file systems, attempts to create a root directory (ie, a drive letter or root UNC path) will fail. If the root directory exists, then it will fail with EPERM. """

And of course, EPERM is the exact error you and I are seeing on Windows.

I am not having any problems with hyp cli on Linux, but I'm trying to set up a hyp sync to back up my kids' files on their Windows gaming PCs.

Octalbyte commented 3 years ago

Thanks @Michael-S ! I think I'll open a PR for this.

Michael-S commented 3 years ago

Cool! I'm too new to Node to solve this myself.