0

I have a nodejs app in which I am trying to use the node module called robe. Here is the error I am getting when I start the app:

 function* promiseToGenerator(promise) {
         ^
 Error loading module node_modules/koa
 SyntaxError: Unexpected token *

I have had trouble with the : function* notation elsewhere as well. I am running this on node version 0.10.25.

anon_945500
  • 269
  • 3
  • 12

1 Answers1

4

You should use a newer version node.js.

Generator support was first added in v0.11.0, but then you needed the --harmony flag to use them. In version 4.0.0 they became enabled by default.

If you don't have a specific reason why you are version locked to 0.10.25, I recommend installing nvm and then using nvm install stable to switch to the latest stable: version 5.4.0 .

Community
  • 1
  • 1
Paul
  • 139,544
  • 27
  • 275
  • 264