1'use strict'; 2require('../common'); 3const assert = require('assert'); 4const { execFileSync } = require('child_process'); 5 6const entryPoints = ['iDoNotExist', 'iDoNotExist.js', 'iDoNotExist.mjs']; 7const node = process.argv[0]; 8 9for (const entryPoint of entryPoints) { 10 try { 11 execFileSync(node, [entryPoint], { stdio: 'pipe' }); 12 } catch (e) { 13 assert(e.toString().match(/Error: Cannot find module/)); 14 continue; 15 } 16 assert.fail('Executing node with inexistent entry point should ' + 17 `fail. Entry point: ${entryPoint}`); 18} 19