nodenv / node-build

Install NodeJS versions
MIT License
271 stars 80 forks source link

Build fails on macOS M1: mkdir: cannot set permissions #839

Closed AlexCzar closed 1 year ago

AlexCzar commented 1 year ago

node-build --compile 21.1.0 fails with

mkdir: cannot set permissions '/var/folders/ty/6r9cq6bs047_f23vx4dmlvcw0000gp/T': Permission denied
node-build: TMPDIR=/var/folders/ty/6r9cq6bs047_f23vx4dmlvcw0000gp/T is set to a non-accessible location

the permissions for that folder:

/bin/ls -lde /var/folders/ty/6r9cq6bs047_f23vx4dmlvcw0000gp/T
drwx------@ 434 username  staff  13888 Nov  2 11:24 /var/folders/ty/6r9cq6bs047_f23vx4dmlvcw0000gp/T

This is a corporate laptop, it probably has some additional hardening on top of macOS' defaults. Note the permissions, the folder is, in fact, accessible. My guess is, node-build is attempting to relax permissions which is prohibited by some hardening policy.

AlexCzar commented 1 year ago

I'm not sure, what exactly is going on, but turns out the culprit isn't macOS or node-build, but instead a combination of macOS, node-build and rust uutils, I switched to built-in coreutils and the build works successfully.