thecodejack / svelte-file-dropzone

Svelte component for fileupload
https://svelte-file-dropzone.netlify.app/
255 stars 45 forks source link

local development `npm install` fails #158

Closed Stijn-B closed 7 months ago

Stijn-B commented 8 months ago

Hi, I wanted to look into how hard/easy it would be to add Typescript types to the events so I tried git clone and then npm install but I'm getting an error.

I couldn't figure out how to resolve this.

@arackaf if you can help me get up and running I'd love to try adding Typescript support to this package. I'm no expert but looking at https://github.com/thecodejack/svelte-file-dropzone/issues/89 it seems easy/accessible enough

$ npm install file-selector
npm ERR! code 1
npm ERR! path /home/stijn/Downloads/svelte-file-dropzone/node_modules/@sveltejs/kit
npm ERR! command failed
npm ERR! command sh -c node postinstall.js
npm ERR! node:internal/process/esm_loader:34
npm ERR!       internalBinding('errors').triggerUncaughtException(
npm ERR!                                 ^
npm ERR! 
npm ERR! Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/stijn/Downloads/svelte-file-dropzone/node_modules/magic-string/dist/magic-string.es.mjs' imported from /home/stijn/Downloads/svelte-file-dropzone/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js
npm ERR! Did you mean to import magic-string/dist/magic-string.cjs.js?
npm ERR!     at finalizeResolution (node:internal/modules/esm/resolve:264:11)
npm ERR!     at moduleResolve (node:internal/modules/esm/resolve:917:10)
npm ERR!     at defaultResolve (node:internal/modules/esm/resolve:1130:11)
npm ERR!     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
npm ERR!     at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
npm ERR!     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
npm ERR!     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
npm ERR!     at link (node:internal/modules/esm/module_job:84:36) {
npm ERR!   code: 'ERR_MODULE_NOT_FOUND',
npm ERR!   url: 'file:///home/stijn/Downloads/svelte-file-dropzone/node_modules/magic-string/dist/magic-string.es.mjs'
npm ERR! }
npm ERR! 
npm ERR! Node.js v20.11.0
arackaf commented 7 months ago

Hey! Not sure why this wasn't working. npm i from the root directory works for me, even from a clean slate. And the demo folder should be its own svelte-kit web app that should let you test the dropzone as you code in there.

That said, TS should already be supported by this library - see my comment here:

https://github.com/thecodejack/svelte-file-dropzone/issues/89#issuecomment-2041232613