You can install
npm i -D @swc/core @swc/cli
yarn add --dev @swc/core @swc/cli
This will download a prebuilt binary instead of building swc if possible.
Currently prebuilt binaries are provided only for
mac (x64) /
linux (x86_64) /
win32-x64 and for some of node js versions (8, 10, 12, 13).
To use swc in other environments, you should install the nightly version of rust first. It can be done with
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly
If you are using windows, please go to rustup.rs.
After installing rust, you can install swc via npm / yarn.