exportdefaultfunction () { return inquirer.prompt([ { type: 'input', name: 'projectName', message: 'set project name', validate(input) { if (input) returntrue return'Please enter project name' }, }, { type: 'list', name: 'frame', message: 'please select a frame', choices: ['vue', 'react'], validate(input) { // Declare function as asynchronous, and save the done callback var done = this.async() // Do async stuff setTimeout(function () { if (typeof input !== 'number') { // Pass the return value in the done callback done('You need to select a frame') return } // Pass the return value in the done callback done(null, true) }, 3000) }, }, ]) }