lv_img_conv icon indicating copy to clipboard operation
lv_img_conv copied to clipboard

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

Open bblaette opened this issue 2 years ago • 2 comments

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

bblaette avatar Dec 27 '22 22:12 bblaette

Thank you for this, just helped me!

emillindq avatar Mar 24 '23 09:03 emillindq

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.

jkhax0r avatar May 18 '24 04:05 jkhax0r