Merge pull request #11850 from yuku/fix-11848

Dealing with dependencies which don't export package.json
This commit is contained in:
Alexandre BODIN 2021-12-14 14:06:15 +01:00 committed by GitHub
commit 30db467072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,12 @@ const getEnabledPlugins = async strapi => {
const installedPlugins = {};
for (const dep in strapi.config.get('info.dependencies', {})) {
const packagePath = join(dep, 'package.json');
const packageInfo = require(packagePath);
let packageInfo;
try {
packageInfo = require(packagePath);
} catch {
continue;
}
if (isStrapiPlugin(packageInfo)) {
validatePluginName(packageInfo.strapi.name);