diff --git a/packages/core/src/config/config-resolvers.ts b/packages/core/src/config/config-resolvers.ts index 43d07a5c5d..351f0411b7 100644 --- a/packages/core/src/config/config-resolvers.ts +++ b/packages/core/src/config/config-resolvers.ts @@ -136,7 +136,14 @@ export async function resolvePlugins( const absolutePluginPath = existsSync(maybeAbsolutePluginPath) ? maybeAbsolutePluginPath : // For plugins imported from packages specifically - require.resolve(plugin, { paths: [configDir, __dirname] }); + require.resolve(plugin, { + paths: [ + // Plugins imported from the node_modules in the project directory + configDir, + // Plugins imported from the node_modules in package install directory (for example, npx cache directory) + __dirname, + ], + }); if (!pluginsCache.has(absolutePluginPath)) { let requiredPlugin: ImportedPlugin | undefined;