File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2-
3- import { resolve } from 'path'
2+ import { resolve , join } from 'path'
43import parseArgs from 'minimist'
54import Server from '../server'
65import build from '../server/build'
6+ import { exists } from 'mz/fs'
77
88const argv = parseArgs ( process . argv . slice ( 2 ) , {
99 alias : {
@@ -23,6 +23,15 @@ build(dir)
2323 const srv = new Server ( { dir, dev : true } )
2424 await srv . start ( argv . port )
2525 console . log ( '> Ready on http://localhost:%d' , argv . port )
26+
27+ // Check if pages dir exists and warn if not
28+ if ( ! await exists ( join ( dir , 'pages' ) ) ) {
29+ if ( await exists ( join ( dir , '..' , 'pages' ) ) ) {
30+ console . warn ( '> No `pages` directory found. Did you mean to run `next` in the parent (`../`) directory?' )
31+ } else {
32+ console . warn ( '> Couldn\'t find a `pages` directory. Please create one under the project root' )
33+ }
34+ }
2635} )
2736. catch ( ( err ) => {
2837 console . error ( err )
You can’t perform that action at this time.
0 commit comments