code: function findAllNodeModules(startDir) {
  	let dir = path.resolve(startDir);
  	let dirs = [];
  	const { root } = path.parse(startDir);
  
  	// eslint-disable-next-line no-constant-condition
  	while (true) {
  		const joined = path.join(dir, 'node_modules');
  		if (existsSync(joined)) {
  			dirs.push(joined);
  		}
  		if (dir === root) {
  			return dirs;
  		}
  		dir = path.dirname(dir);
  	}
  }
docs: attempt to resolve a dependency, giving $CWD/node_modules priority: function resolveDep(dep, cwd) { try { return requireRelative.resolve(dep, cwd || process.cwd()); } catch (e) {} try { return require.resolve(dep); } catch (e) {} return dep; }