diff --git a/src/util/resolve-dir.js b/src/util/resolve-dir.js index 1f015efbb9..5ffc7583d3 100644 --- a/src/util/resolve-dir.js +++ b/src/util/resolve-dir.js @@ -14,9 +14,13 @@ export default async (dir) => { if (await fs.exists(testPath)) { const packageJSON = JSON.parse(await fs.readFile(testPath, 'utf8')); - if (packageJSON.devDependencies && packageJSON.devDependencies['electron-prebuilt-compile'] - && !/[0-9]/.test(packageJSON.devDependencies['electron-prebuilt-compile'][0])) { - global._resolveError = () => console.error('You must depend on an EXACT version of "electron-prebuilt-compile" not a range'.red); + if (packageJSON.devDependencies && packageJSON.devDependencies['electron-prebuilt-compile']) { + if (!/[0-9]/.test(packageJSON.devDependencies['electron-prebuilt-compile'][0])) { + global._resolveError = () => console.error('You must depend on an EXACT version of "electron-prebuilt-compile" not a range'.red); + return null; + } + } else { + global._resolveError = () => console.error('You must depend on "electron-prebuilt-compile" in your devDependencies'.red); return null; }