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
tl;dr: (Re)install a x64 build of Node.js.
-
Start a new shell using Rosetta2
$ arch -x86_64 zsh
-
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
-
Still in that shell, reinstall and build npm dependencies from scratch
$ rm -rf node_modules $ yarn cache clean $ yarn install