If you are using Docker, and if your host and Docker are in two different archs - try below. Mine got fixed by specifying archs to supports in yarn https://github.com/swc-project/swc/issues/2898#issuecomment-1180845472