4

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.

Allleex
  • 137
  • 9

2 Answers2

1

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

WeiJun
  • 51
  • 10
-1

I solved this. It happened with metaplex, to be precise, the candy machine uses some node_module named canvas which struggles with arm64 arch. It is per default on x86_64 arch so you need to change it. There are some tutorials. Then if you want to use the candy machine you are still going to get this error. What you need to do next is just downgrade node to 14.18 and try again.

Allleex
  • 137
  • 9
  • 5
    Could you please share some of the links to those tutorials? I seem to be running into this exact problem and I'm not able to find anything to change Canvas dependency on x86_64 to arm64. Thanks. – KcC0 Jan 21 '22 at 09:37