diff --git a/lib/builder.js b/lib/builder.js index ad5bd872f1..24eb400cad 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -90,10 +90,11 @@ export default class Builder extends Tapable { if (this._nuxtPages) { if (!fs.existsSync(join(this.options.srcDir, 'pages'))) { + let dir = this.options.srcDir if (fs.existsSync(join(this.options.srcDir, '..', 'pages'))) { - console.error('> No `pages` directory found. Did you mean to run `nuxt` in the parent (`../`) directory?') // eslint-disable-line no-console + console.error(`> No 'pages' directory found in ${dir}. Did you mean to run 'nuxt' in the parent ('../') directory?`) // eslint-disable-line no-console } else { - console.error('> Couldn\'t find a `pages` directory. Please create one under the project root') // eslint-disable-line no-console + console.error(`> Couldn't find a 'pages' directory in ${dir}. Please create one under the project root`) // eslint-disable-line no-console } process.exit(1) }