mirror of
https://github.com/strapi/strapi.git
synced 2025-12-14 00:29:32 +00:00
Merge pull request #11850 from yuku/fix-11848
Dealing with dependencies which don't export package.json
This commit is contained in:
commit
30db467072
@ -60,7 +60,12 @@ const getEnabledPlugins = async strapi => {
|
|||||||
const installedPlugins = {};
|
const installedPlugins = {};
|
||||||
for (const dep in strapi.config.get('info.dependencies', {})) {
|
for (const dep in strapi.config.get('info.dependencies', {})) {
|
||||||
const packagePath = join(dep, 'package.json');
|
const packagePath = join(dep, 'package.json');
|
||||||
const packageInfo = require(packagePath);
|
let packageInfo;
|
||||||
|
try {
|
||||||
|
packageInfo = require(packagePath);
|
||||||
|
} catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isStrapiPlugin(packageInfo)) {
|
if (isStrapiPlugin(packageInfo)) {
|
||||||
validatePluginName(packageInfo.strapi.name);
|
validatePluginName(packageInfo.strapi.name);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user