diff --git a/packages/nx/src/daemon/tmp-dir.ts b/packages/nx/src/daemon/tmp-dir.ts index 87327421d2d87..f4217057ee538 100644 --- a/packages/nx/src/daemon/tmp-dir.ts +++ b/packages/nx/src/daemon/tmp-dir.ts @@ -21,7 +21,7 @@ export const DAEMON_OUTPUT_LOG_FILE = join( 'daemon.log' ); -export const socketDir = process.env.NX_DAEMON_SOCKET_DIR || createSocketDir(); +export const socketDir = createSocketDir(); export const DAEMON_SOCKET_PATH = join( socketDir, @@ -61,7 +61,7 @@ function socketDirName() { */ function createSocketDir() { try { - const dir = socketDirName(); + const dir = process.env.NX_DAEMON_SOCKET_DIR ?? socketDirName(); ensureDirSync(dir); return dir; } catch (e) {