Search code examples
canvasapple-m1metaplex

What does "symbol not found in flat namespace '_cairo_fill'" mean?


What does the error Error: dlopen(/Users/me/Documents/metaplex-master/js/node_modules/canvas/build/Release/canvas.node, 0x0001): symbol not found in flat namespace '_cairo_fill' mean? I get this error when running ts-node ./packages/cli/src/candy-machine-cli.ts --version. How can I solve this. I know there are some problems with canvas on M1 and I already have it setup for the arm64 architecture.

I also get this error when doing some other stuff with canvas on another projects. I am on a M1 pro MacBook Pro.


Solution

  • I got the same error too. My solution:

    1. Uninstall the current node: nvm uninstall 16
    2. Open a terminal with Rosetta, which switches the arch to x86_64. (You can check the arch of current terminal by uname -m command)
    3. Use that terminal to reinstall node again: nvm install 16 (and you got the x86_64 version node in your machine)
    4. Delete node_modules and reinstall dependencies: npm i

    Ref: https://github.com/Automattic/node-canvas/issues/1733#issuecomment-807925516