问题
I am creating a webapp using YOMEN on my new MAC machine, but the terminal does not allows me to select the choices using space key. Here is what I am getting:
=====================================================================
_-----_
| | .--------------------------.
|--(o)--| | Welcome to Yeoman, |
`---------´ | ladies and gentlemen! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your app.
? What more would you like? (Press <space> to select)
❯◉ Bootstrap
◯ Sass
◯ Modernizr
/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:9229
throw e;
^
ReferenceError: parent is not defined
at AnonymousObserver._onNext (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:4259:63)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1863:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1795:35)
at AutoDetachObserverPrototype.next (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:9226:23)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1795:35)
at Subject.Rx.Subject.addProperties.onNext (/Admins-MacBook-Pro-3:V1 jyotipuri$
===============================================================
Please help.
回答1:
Time of writing: [2014.12.11 1:34AM PST]
It is due to the rx.js, yeoman's dependency, released broken version.
The yeoman mod has patched, but it is still not working yet. After they successfully patch to the right version, try this:
npm uninstall -g yo
npm cache clean
npm install -g yo
Here are the related links:
- https://github.com/yeoman/yo/issues/247
- https://github.com/Reactive-Extensions/RxJS/issues/434
[UPDATE] - 2014.12.11 4:10AM PST
While yeoman patch is still not working, the fix is PR'ed in RxJS but not merged yet.
Link: https://github.com/Reactive-Extensions/RxJS/commit/dcfcf0f537f6a911ed8fca29edb62f415e17bd76
You can directly change the source code to use yo now.
You'll have to give write permission to /usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js.
And then change the line
shouldRun = predicate.call(thisArg, value, count++, parent);
to
shouldRun = predicate.call(thisArg, value, count++, source);
Source: https://github.com/yeoman/yo/issues/247#issuecomment-66600064
[UPDATE] - 2014.12.11 5:25AM PST]
Issue is fixed! Updated RxJS is submitted to npm.
Run the following commands:
npm uninstall -g yo
npm cache clean
npm install -g yo
Source: https://github.com/yeoman/yo/issues/247#issuecomment-66617591
来源:https://stackoverflow.com/questions/27416779/issue-with-selection-options-on-mac-terminal-scaffloding-web-application-using