Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ function getHostname () {
try {
return os.hostname();
} catch (e) {
return '';
/**
* This is most likely Windows 7 which is known to cause os.hostname() to break
* @see https://github.com/nodejs/node/issues/41297
* @see https://github.com/libuv/libuv/issues/3260
*
* Fallback to take hostname from environment variables
* @see https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/hostname#notes
*/
// eslint-disable-next-line no-underscore-dangle
return process.env._CLUSTER_NETWORK_NAME_ || process.env.COMPUTERNAME || 'hostname';
}
}

Expand Down