Closed redpanda closed 9 months ago
Error: Bindings not found
is emitted by SWC (a very fast TypeScript compiler written in Rust) when it fails to find and load its native library counterpart. This is almost always due to the fact that you ran 'npm i' (or equivalent) from one execution context (e.g. from a OSX terminal using a M1 build of node) but then run your test in a different execution context (e.g. running tests through docker or a x64 build of node).
Simply running npm i
from the target execution environment is generally sufficient to resolve that issue, but it some cases, you may need to delete all of your node_modules
directories, then run npm -i
again.
You may also try the following command to find out which SWC bindings packages are currently installed:
find . -name '@swc' -exec 'ls' '-l' '{}' ';'
Compare that list to the output of the following command:
node -e 'console.log(`${process.platform}-${process.arch}`)'
Hello @mjameswh,
Thanks for your feedback.
Despite deleting the node_modules
folder and reinstalling the packages, I still had the bindings problem.
I also ran the two commands concerning SWC bindings packages and got the same thing: core-darwin-x64
.
However, I managed to fix the error by installing @swc/cli
and @swc/core
at the root of the project based on this GitHub issue. But I'm not sure I should do something like that... 😅
I'll re-run some tests in a Docker container.
Closing as OP found a solution, and I can't repro.
What are you really trying to do?
I'm running some experiments with mocha on the current samples, and I've some issues with the food-delivery sample.
Describe the bug
When I run the tests, I have the following error during the worker instantiation:
Minimal Reproduction
I created a branch on my fork; the code is here and the diff here.
To run the tests you have to run the following commands:
Environment/Versions
Additional context