diff --git a/packages/cli/src/utils/serve.js b/packages/cli/src/utils/serve.js index 055b6ff601..7b4214bd06 100644 --- a/packages/cli/src/utils/serve.js +++ b/packages/cli/src/utils/serve.js @@ -24,7 +24,7 @@ export async function serve (cmd) { const distStat = await fs.stat(options.generate.dir).catch(err => null) // eslint-disable-line node/handle-callback-err const distPath = join(options.generate.dir.replace(process.cwd() + sep, ''), sep) if (!distStat || !distStat.isDirectory()) { - throw new Error('Output directory `' + distPath + '` does not exists, please use `nuxt generate` before `nuxt start` for static target.') + throw new Error('Output directory `' + distPath + '` does not exist, please use `nuxt generate` before `nuxt start` for static target.') } const app = connect() app.use(compression({ threshold: 0 })) diff --git a/packages/cli/test/unit/serve.test.js b/packages/cli/test/unit/serve.test.js index c229113160..0090eca21a 100644 --- a/packages/cli/test/unit/serve.test.js +++ b/packages/cli/test/unit/serve.test.js @@ -22,7 +22,7 @@ describe('serve', () => { test('error if dist/ does not exists', () => { mockGetNuxtConfig({ target: TARGETS.static }) const cmd = NuxtCommand.from(serve) - expect(cmd.run()).rejects.toThrow(new Error('Output directory `dist/` does not exists, please use `nuxt generate` before `nuxt start` for static target.')) + expect(cmd.run()).rejects.toThrow(new Error('Output directory `dist/` does not exist, please use `nuxt generate` before `nuxt start` for static target.')) }) test('no error if dist/ dir exists', async () => {