You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
When executing as root on OSX, there is no explicit tmpdir provided from the environment variables. When using os.tmpdir(), node correctly falls back to '/tmp'. However when running scripts via npm, it seems that the environment variable TMPDIR is set to the cwd when undefined. This causes os.tmpdir() to incorrectly return the cwd as the tmp directory.
in my package.json
"scripts": {
"test": "echo $TMPDIR"
},
npm test#=> correct temp dir
sudo npm test#=> current working directory (??)
node -e "console.log(process.env.TMPDIR)"#=> correct temp dir
sudo node -e "console.log(process.env.TMPDIR)"#=> undefined