express-graphql icon indicating copy to clipboard operation
express-graphql copied to clipboard

ReferenceError: Promise is not defined

Open BVJin opened this issue 10 years ago • 2 comments

I am following the tutorial http://graphql.org/docs/getting-started/,

and when I tried to hit the http://localhost:3000/graphql, I get the error like this:

ReferenceError: Promise is not defined at /gls16_api/node_modules/express-graphql/dist/index.js:66:9 at Layer.handle as handle_request at trim_prefix (/gls16_api/node_modules/express/lib/router/index.js:312:13) at /gls16_api/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/gls16_api/node_modules/express/lib/router/index.js:330:12) at next (/gls16_api/node_modules/express/lib/router/index.js:271:10) at expressInit (/gls16_api/node_modules/express/lib/middleware/init.js:33:5) at Layer.handle as handle_request at trim_prefix (/gls16_api/node_modules/express/lib/router/index.js:312:13) at /gls16_api/node_modules/express/lib/router/index.js:280:7

anyone can help?

BVJin avatar Apr 22 '16 21:04 BVJin

Your node version is too old (maybe 0.10, 0.11), so you should upgrade your node or provide a Promise polyfill.

chentsulin avatar Apr 27 '16 03:04 chentsulin

@chentsulin has your solution - Promise was added to node in a more recent version than one you're probably running now.

leebyron avatar May 26 '16 23:05 leebyron