Skip to content

Commit 40be8e4

Browse files
committed
fix: update
1 parent fa967cc commit 40be8e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ function lifecycle (pkg, stage, wd, opts) {
9999

100100
// 'nobody' typically doesn't have permission to write to /tmp
101101
// even if it's never used, sh freaks out.
102-
if (!opts.unsafePerm) env.TMPDIR = path.join(wd, 'node_modules')
102+
if (!opts.unsafePerm) {
103+
const tmpdir = path.join(wd, 'node_modules')
104+
if (!fs.existsSync(tmpdir)) fs.mkdirSync(tmpdir)
105+
env.TMPDIR = tmpdir
106+
}
103107

104108
lifecycle_(pkg, stage, wd, opts, env, (er) => {
105109
if (er) return reject(er)

0 commit comments

Comments
 (0)