Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afr-dt/152e14fff619bb2d8315377412f29068 to your computer and use it in GitHub Desktop.
Save afr-dt/152e14fff619bb2d8315377412f29068 to your computer and use it in GitHub Desktop.
Fix `dyld[]: missing symbol called` errors when running Node.js programs on M1 Macs

Problem

If you're getting this kind of error when running Node.js programs with binary dependencies that don't support M1 yet, e.g.:

$ yarn test
dyld[51175]: missing symbol called
dyld[51176]: missing symbol called

Solution

tl;dr: (Re)install a x64 build of Node.js.

Steps to follow

  1. Start a new shell using Rosetta2

    $ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment