On Linux (Ubuntu 20.04), using yarn 3.2.0, had an issue where yarn install would always fail with a number of "permission denied" during the Link step, where it was trying to use other modules installed in node_modules as part of the same install (e.g. node-gyp, node-gyp-build, node-pre-gyp, prebuild-install).
Turns out after a long period of investigation (mainly focused on file permissions because of the permission denied error) that it was in fact down to Yarn's use of the /tmp folder, which it apparently uses during its Link step for placing and executing some files. This is all very well, but not on a Linux server which is following "best practice" in having the noexec flag on the /tmp mount point (see: /opt/fstab) ! noexec prevents use of executables, hence the permission denied. If I take the noexec flag off yarn works flawlessly.
So the question is, how do I get around this behaviour in Yarn so that I don't have to break best practice on the /tmp folder? I have dug hard into yarn's configuration options but there appears to be nothing in this area.