diff --git a/lib/version.js b/lib/version.js index 0eefc9834502..875db756bb50 100755 --- a/lib/version.js +++ b/lib/version.js @@ -33,6 +33,16 @@ program }) .parse(process.argv); +const hasVersionFile = fs.existsSync(CWD + '/pages/en/versions.js'); +if (!hasVersionFile) { + console.error( + `${chalk.yellow( + 'No versions.js file found!' + )}\nYou should create your versions.js file in pages/en directory.\nPlease refer to https://docusaurus.io/docs/en/versioning.html.` + ); + process.exit(1); +} + if (typeof version === 'undefined') { console.error( `${chalk.yellow(