vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
781 stars 50 forks source link

Bindings not found error #74

Closed jjtfsalgado closed 1 year ago

jjtfsalgado commented 1 year ago

Hey there

If you have this problem, you probably ran into is https://github.com/npm/cli/issues/4828. The bug happens when npm generates the lockfile with an existing node_modules that contains platform-specific dependencies.

Two solutions:

npm install --force --save-optional \
        @swc/core \
        @swc/core-darwin-arm64 \
        @swc/core-darwin-x64 \
        @swc/core-linux-arm-gnueabihf \
        @swc/core-linux-arm64-gnu \
        @swc/core-linux-arm64-musl \
        @swc/core-linux-x64-gnu \
        @swc/core-linux-x64-musl \
        @swc/core-win32-arm64-msvc \
        @swc/core-win32-ia32-msvc \
        @swc/core-win32-x64-msvc

Original post

Running vite we occasionally come across with this error. The way we found to overcome this was to remove node_modules and reinstall it. Do you guys have any ideas what is causing this?

Screenshot 2023-03-24 at 10 03 06
kaungpyaesoneaunggic commented 5 months ago

npm update worked for me with similar scenarios. Don't knonw if already answered though.

ChronosXBT commented 4 months ago

for Android arm64 use this command pnpm add --save-optional @swc/core-android-arm64

or if you use npm npm install --save-optional @swc/core-android-arm64

keep in mind that this package hasn't been updated in a while, at the time of writing this comment, latest swc core package version is 1.4.7 while swc/core-android-arm64 package version is 1.3.11

but atleast it works