Node & M1 Mac: dyld[]: missing symbol called
Asked Answered
K

2

8

i really need your help.

I am having problems with node (v16.8.0) and my macOS with arm processor. Every time i want to run the backend of this project i get this:

dyld[17378]: missing symbol called

I have already followed the whole discussion on this other post. I tried to do a clean install of node for arm with rosetta2, but if I run node -p "process.arch" I always get x64.

I've also tried with a more aggressive approach:

  • Removed all Node files, everything, in all folders and subfolder making sure that node was completely uninstalled
  • Removed the libraries and removed the dependencies
  • Re-installed Node with brew (using arch)
  • Re-installed libraries and dependencies

Since I have already removed and reinstalled node 5 times just today, could you please help me to find out how can I solve this problem? Thank you!

Kempe answered 24/10, 2022 at 17:18 Comment(1)
This post has a great explanation of this common problem on M1, M2, or M3 Macs. rubyonmac.dev/…Disorderly
K
-2

Once again, found the solution.

The solution was:

  • Clean up again everything. This means uninstall and delete all files for: yarn, npm, nvm, and node
  • Re-install everything via homebrew
  • Delete all node_modules
  • Re-run yarn/npm install in the repo
Kempe answered 25/10, 2022 at 18:5 Comment(1)
This doesn't tell what the direct cause is or even how to find it (get some diagnostic info from dyld?). "Reinstall everything" is a band-aid solution that may or may not work.Zannini
R
8

This code snippet from @adrienjoly solved the issue.

    1. Start a new shell using Rosetta2. Rosetta 2 translates apps built for Intel so they will run on Apple Silicon

    $ arch -x86_64 zsh

    2. In that shell, reinstall the x64 version of Node.js

    $ nvm use system
    $ nvm cache clear
    $ nvm uninstall 16 # or the version you need
    $ nvm install 16   # or the version you need
    $ nvm use 16       # or the version you need

    3. Still in that shell, reinstall and build npm dependencies from scratch

    $ rm -rf node_modules
    $ yarn cache clean
    $ yarn install

    Whenever you come back to your project (e.g. after restarting), don't forget to select that same version of Node.js!

    $ nvm use 16 # or the one you installed in step 2

The gist is we need to uninstall and install node in x64 architecture.

We clear out the cache and other dependencies so that they are also versions which are compatible with x64 build of Node.js

Rolfrolfe answered 2/8, 2023 at 4:1 Comment(0)
K
-2

Once again, found the solution.

The solution was:

  • Clean up again everything. This means uninstall and delete all files for: yarn, npm, nvm, and node
  • Re-install everything via homebrew
  • Delete all node_modules
  • Re-run yarn/npm install in the repo
Kempe answered 25/10, 2022 at 18:5 Comment(1)
This doesn't tell what the direct cause is or even how to find it (get some diagnostic info from dyld?). "Reinstall everything" is a band-aid solution that may or may not work.Zannini

© 2022 - 2024 — McMap. All rights reserved.