jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 215 forks source link

npm pulls in incompatible version of Dropbox SDK #245

Closed willemneal closed 5 years ago

willemneal commented 6 years ago

npm install returns

src/backend/Dropbox.ts:400:40 - error TS2339: Property 'path' does not exist on type 'UploadErrorPath'.

400           cb(WriteErrorToError(upError.path.reason, p, GetErrorMessage(e)));
                                           ~~~~

src/backend/Dropbox.ts:510:40 - error TS2339: Property 'path' does not exist on type 'UploadErrorPath'.

510           cb(WriteErrorToError(upError.path.reason, p, GetErrorMessage(e)));
                                           ~~~~
jvilk commented 6 years ago

Ahh, I saw your PR before I saw this issue. This problem is likely due to a mismatch in the version of the Dropbox SDK it's pulling in. yarn install should work.

One way to fix npm install is to change the version of the Dropbox SDK specified in package.json to refer specifically to the version that Yarn pulls in (2.5.7).

willemneal commented 6 years ago

Ah, cool thanks. That seemed to fix it. I'll switch to using yarn in my other project.

jvilk commented 6 years ago

I'll keep this open, since I'd like to keep the npm workflow working; perhaps I'll start generating NPM and Yarn lockfiles. Maybe a tool like this one will work to automate the process.

I switched to Yarn for all of my projects awhile back, and have been very pleased with it so far. If you haven't used it before, there are a few command line differences, but I've since adapted to and prefer Yarn's nomenclature for actions.

willemneal commented 6 years ago

Thanks, I'll look into it. I'm very new to typescript and node and just used npm. I've seen yarn around but never got around to looking into it, but some other issues I've had with npm I think it's about time.

jvilk commented 6 years ago

TypeScript is a lot of fun once you figure out how to configure it for your needs (e.g., what type of modules to generate, what version of ECMAScript to generate, etc). It has saved me from thousands of dumb bugs that would normally take a long time for me to debug.

If you have trouble integrating BrowserFS with your project, feel free to open up issues with questions.

willemneal commented 6 years ago

Yeah, it's been a blast but the setup is hard. I just got back into js after years of being away and there was just so much to it. I don't understand having a large javascript project and not using types.

Thanks for the help. I'm using https://github.com/orbitdb/orbit-db, which is a replicated p2p append-only log. The goal is to use isomorphic-git + BrowserFS so that only changes are appended.

I also want to use a web service worker so that http request are routed to the fs/database. So if you wanted another user's page you would sync up with their log/fs.

Also, I just noticed that you created Browsix, which I'm a big fan of. And now with emscripten's filesystem as a backend, Browsix 2.0 could be big. Have you seen https://github.com/tbfleming/cib? I think we're really close to a bootstrapped real wasm VM.

tomByrer commented 6 years ago

I tried out Yarn long ago on Windows, but was very buggy. I feel the new vastly improved versions of NPM don't warrant installing another dependents manager. So NPM compat would be awesome / needed.

I think it is simple enough; just remove the carrot from "dropbox": "^2.5.7"? I'd make a PR, but seems you have other PRs that need merging.

jvilk commented 6 years ago

You can issue a PR; none of the existing PRs are ready for merging.

jvilk commented 5 years ago

I will likely fix this when I fix #248 this weekend.

jvilk commented 5 years ago

This issue should now be fixed.