fix: plugin does not exist
This commit is contained in:
parent
0dbc01c330
commit
29b47c1d40
@ -83,12 +83,10 @@ export class PluginManager {
|
||||
static async getPackageName(name: string) {
|
||||
const prefixes = this.getPluginPkgPrefix();
|
||||
for (const prefix of prefixes) {
|
||||
try {
|
||||
await import(`${prefix}${name}`);
|
||||
const pkg = resolve(process.env.NODE_MODULES_PATH, `${prefix}${name}`, 'package.json');
|
||||
const exists = await fsExists(pkg);
|
||||
if (exists) {
|
||||
return `${prefix}${name}`;
|
||||
} catch (error) {
|
||||
// console.log(error);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
throw new Error(`${name} plugin does not exist`);
|
||||
|
Loading…
Reference in New Issue
Block a user