Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bblaette opened this issue Dec 27, 2022 · 2 comments

Comments

@bblaette
Copy link

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
Copy link

Thank you for this, just helped me!

@jkhax0r
Copy link

jkhax0r commented May 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants