diff --git a/packages/ruleset-migrator/src/requireResolve.ts b/packages/ruleset-migrator/src/requireResolve.ts index 7ebf73566..6b0c484cf 100644 --- a/packages/ruleset-migrator/src/requireResolve.ts +++ b/packages/ruleset-migrator/src/requireResolve.ts @@ -1,6 +1,9 @@ +import { createRequire } from 'module'; + export default ((id, opts) => { try { - return require.resolve(id, opts); + const req = createRequire(process.cwd()); + return req.resolve(id, opts); } catch { return null; }