I just installed Manjaro and am waiting for deja-dup to finish restoring my home directory. While I let that run, I installed Emacs using pacman. I tried running it with the -nw flag, but it complains “error while loading shared libraries: libXaw3d.so.6: cannot open shared object file: no such file or directory.” I installed the xaw3d package, but got the same result. Then I ran ldd against the Emacs binary. All dependencies resolved properly.
Yes, just figured out the issue. TL;DR: It was pilot error.
I have ~/.local/bin in PATH ahead of /usr/bin. A stale copy of Emacs 25.2 lives there. I’d completely forgotten about it. When I ran ldd, I explicitly mentioned /usr/bin/emacs. I should have been more careful in my “investigation” of the problem. Apologies for the noise.
I’ve marked the below answer as the solution to your question as it is by far the best answer you’ll get.
However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or or if you agree)
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.