lvgl / lv_img_conv

Image converter for LVGL, written in JS
https://lvgl.github.io/lv_img_conv/
Other
89 stars 42 forks source link

Error: swc compiler requires either @swc/core or @swc/wasm to be installed... #30

Open bblaette opened 1 year ago

bblaette commented 1 year ago

When trying to install this globally, I encountered the following error:

$ lv_img_conv 
    /home/luda/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/transpilers/swc.ts:45
        throw new Error(
              ^
    Error: swc compiler requires either @swc/core or @swc/wasm to be installed as a dependency.  See https://typestrong.org/ts-node/docs/transpilers
    ...

After researching the issue, I could solve it by installing the devDependencies for ts-node.

$ cd lv_img_conv/
$ sudo npm install ts-node --save-dev
$ lv_img_conv 
  Options:
      --help               Show help                                       [boolean]
      --version            Show version number                             [boolean]
      --output-file, -o    output file path (for single-image conversion)   [string]
    ...

Consider this closed. I'm leaving this here in case it helps others as well

emillindq commented 1 year ago

Thank you for this, just helped me!

jkhax0r commented 4 months ago

I'm on windows and had similar issue. I think just updating the package worked...

npm remove @swc/core npm remove @swc/helpers npm install @swc/core --save-dev npm install @swc/helpers --save-dev

And what's nice is I can simply run ts-node lv_img_conf.js on windows, same as the "linux" instructions.