babel/generator-babel-boilerplate

Can not start the project!

Closed this issue · 9 comments

Janry:magic-time wangzhili$ yo babel-boilerplate magic-time
(node:59963) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:59963) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

     _-----_     ╭──────────────────────────╮
    |       |    │   Welcome to the Babel   │
    |--(o)--|    │    Library Boilerplate   │
   `---------´   │        generator!        │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

[?] What is the Github username/organization for this project? (janrywang) 

events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'then' of undefined
    at Base.prompt (/Users/wangzhili/.node/lib/node_modules/generator-babel-boilerplate/node_modules/yeoman-generator/lib/base.js:240:44)
    at module.exports.generators.Base.extend.prompting (/Users/wangzhili/.node/lib/node_modules/generator-babel-boilerplate/app/index.js:82:17)
    at Object.<anonymous> (/Users/wangzhili/.node/lib/node_modules/generator-babel-boilerplate/node_modules/yeoman-generator/lib/base.js:439:23)
    at /Users/wangzhili/.node/lib/node_modules/generator-babel-boilerplate/node_modules/yeoman-generator/node_modules/run-async/index.js:26:25
    at /Users/wangzhili/.node/lib/node_modules/generator-babel-boilerplate/node_modules/yeoman-generator/node_modules/run-async/index.js:25:19
    at /Users/wangzhili/.node/lib/node_modules/generator-babel-boilerplate/node_modules/yeoman-generator/lib/base.js:440:9
    at runCallback (timers.js:570:20)
    at tryOnImmediate (timers.js:550:5)
    at processImmediate [as _immediateCallback] (timers.js:529:5)

Hey there, @janryWang . Thanks for the issue! And sorry that it's erroring for you 😓

It looks like the issue might be with this line, which is unexpected. That's just the regular old generator API.

Would you be able to help me debug the problem with you by posting your installed versions of yo & this boilerplate?

Thanks! ✌️

This is my node&npm version [node v6.3.1 ,npm v3.10.3)]
yo&boilerplate version[yo v1.8.4 ,Babel-boilerplate v9.0.1]

Thanks! Also, what's your OS?

My OS is X EI Capitan,and I console.log in
node_modules/yeoman-generator/lib/base.js:237

like this


Base.prototype.prompt = function (questions) {
  questions = promptSuggestion.prefillQuestions(this._globalConfig, questions);
  console.log(this.env.adapter.prompt)  <<<<<<<
  return this.env.adapter.prompt(questions).then(function (answers) {
    if (!this.options['skip-cache']) {
      promptSuggestion.storeAnswers(this._globalConfig, questions, answers);
    }

    return answers;
  }.bind(this));

};

//////////

console.log(this.env.adapter.prompt)

result ==>function _prompt() {
  inquirer.prompt.apply(inquirer, arguments);
}

and if I console.log(this.env.adapter), it will show me

TerminalAdapter {}

and TerminalAdapter in this module

yeoman-environment/lib/adapter.js

@janryWang I'm unable to reproduce this 😦

I'm also on El Cap, and I've tried with a few different combos of Node/npm (including the one you're on). Maybe try upgrading to the latest npm and/or clearing your npm cache?

How to clean my npm cache?

The docs should help with that: https://docs.npmjs.com/cli/cache

@janryWang did you ever get this working? Would you have time to pair sometime to go over it?

Going to close as inactive, but please comment here @janryWang if you want to try to figure it out.