@@ -353,7 +353,7 @@ async function main () {
}
-if (process.mainModule === module) {
+if (require.main === module) {
main().catch((error) => {
console.error(error);
process.exit(1);
@@ -9,7 +9,7 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx';
const utils = require('./lib/utils');
const { YARN_VERSION } = require('./yarn');
-if (!process.mainModule) {
+if (!require.main) {
throw new Error('Must call the nan spec runner directly');
@@ -15,7 +15,7 @@ const TAP_FILE_NAME = 'test.tap';
throw new Error('Must call the node spec runner directly');
@@ -31,7 +31,7 @@ async function main () {
main().catch((err) => {
console.error(err);
@@ -200,7 +200,7 @@ For example, these invocations are equivalent:
console.error('Error Occurred:', err);
@@ -109,7 +109,7 @@ function isMajorNightly (version, currentVersion) {
return false;