Fix bypass-age-restriction lib import

This commit is contained in:
TC
2023-01-15 21:12:12 +01:00
parent a51ed89281
commit b518866d24
3 changed files with 12 additions and 3 deletions

View File

@ -10,7 +10,15 @@ const { promisify } = require("util");
*/
const generatePackageJson = async packageName => {
var filepath = join("node_modules", packageName, "package.json");
const packageFolder = join("node_modules", packageName)
if (!existsSync(packageFolder )) {
console.log(
`${packageName} module not found, exiting…`
);
return
}
const filepath = join(packageFolder, "package.json");
if (!existsSync(filepath)) {
console.log(
`No package.json found for ${packageName} module, generating one…`